Goals either side of half-time from Ricardo Vaz Te and Ravel Morrison appeared to have West Ham cruising into the third round of the competition.
Matt Richards' penalty just before the hour mark gave Cheltenham a sniff of a shock, but the visitors were unable to find an equaliser.
Both manager Sam Allardyce and co-chairman David Gold made it clear before the game that, with the Hammers now looking a solid top-flight outfit following last year's promotion, they fancy a decent stab at the cups this season.
Such is the strength of Allardyce's squad compared to last term he was able to make 11 changes from the side which drew at Newcastle on Saturday while still bringing in the likes of Joe Cole, James Tomkins, Jack Collison, Matt Taylor and Vaz Te.
Their first competitive meeting with Cheltenham was certainly a full-blooded encounter with Cole and Town's Ryan Iniss requiring treatment early on, while Alou Diarra's rare appearance ended after half an hour when he departed on a stretcher.
New signing Razvan Rat, predictably dubbed 'Roland' by his team-mates, may have thought he was in for a gentle introduction to English football but the Romanian full-back was given the runaround by speedy Town winger Jermaine McGlashan in the opening stages.
But Cheltenham were largely restricted to long-range efforts in the first half with Richards curling a free-kick over and captain Russell Penn unlucky to see his 20-yard effort bounce on the roof of the net.
West Ham were hardly posing much more of an attacking threat, although they felt they could have had a penalty when Morrison tumbled in the area, only for referee Graham Scott to book him for diving.
But moments later, in the 42nd minute, Morrison was fouled and this time the official awarded a free-kick which Vaz Te expertly curled home from 25 yards.
Allardyce sent on Stewart Downing for Cole at the interval and the £6million signing from Liverpool's tenacity immediately set up Morrison's sparkling strike.
Moments later Downing went agonisingly close to his first Hammers goal but his header flew inches wide while Vaz Te was denied by a fine save from Brown.
Town pulled one back in bizarre circumstances in the 59th minute when Spanish goalkeeper Adrian, making his debut, got in a horrible mix-up with Tomkins and was penalised for a foul on McGlashan, with Richards tucking in the spot-kick.
But the visitors rarely threatened an equaliser - an Iniss header which flew wide was as close as they came - while West Ham should have enjoyed a far more comfortable night but Collison's drive was tipped over, George McCartney's header hit the crossbar and Taylor's late shot was cleared off the line.