His first assignment was to command a recruiting camp near Columbus, and then the Kanawha Brigade of the Department of the Ohio. His brigade joined the Department of Western Virginia and fought successfully in the early Kanawha Valley campaign under Maj. Gen. George B. McClellan. In 1862 the brigade moved to Washington, D.C., and was attached to John Pope's Army of Virginia, but was delayed by McClellan and so did not see action at the Second Battle of Bull Run with the rest of the army. At the beginning of the Maryland Campaign, Cox's brigade became the Kanawha Division of the IX Corps of the Army of the Potomac. In the Maryland campaign, Cox's men took the important city of Frederick, Maryland, and Cox led the assault on the Confederates on September 14, 1862, at the Battle of South Mountain. When corps commander Maj. Gen. Jesse L. Reno was killed at South Mountain, Cox assumed command of the IX Corps. He suggested to Maj. Gen. Ambrose Burnside, formally the commander of IX Corps, but who was commanding a two-corps "wing" of the Army, that he be allowed to return to division command, which was more in keeping with his level of military experience. Burnside refused the suggestion but kept Cox under his supervision at the Battle of Antietam. Burnside allowed Cox to execute all orders from McClellan at the battle, while he remained behind the lines. Cox's advancing IX Corps came within minutes of overwhelming the Confederate right wing at Antietam, when they were hit by A.P. Hill's division, which forced Cox to withdraw closer to Union lines.