On May 28, 1861 Shaw was commissioned as a second lieutenant in the regiment's Company H. Over the next year and a half, he fought with his fellow Massachusetts soldiers in the first Battle of Winchester, the Battle of Cedar Mountain and at the bloody Battle of Antietam. Shaw served both as a line officer in the field and as a staff officer for General George H Gordon. Twice wounded, by the fall of 1862 he was promoted to the rank of captain.