In June 1861 Cobb was commissioned a Captain in the 44th Virginia Infantry, forming the Randolph Guards. In May 1862 he was promoted to Major and within a year promoted to Colonel. He fought in many of the major battles of the Virginia campaign including Fredericksburg, Spotsylvania Court House, The Wilderness, Antietam and Gettysburg. He was wounded at Gettysburg and Chancellorsville where he was also taken prisoner. He was released in a prisoner exchanged and rejoined his regiment following Gen. Lee all the way to Appomattox Court House. In a letter to her brother in Philadelphia, Mrs. Cobb wrote that her home in Farmville had been occupied by the Northern Army and that all that could be taken had. Cobb suffered great financial loss during the war including the destruction and theft of property as well as the death of at least one child.