[48] That June, Governor William Dennison appointed several of the officers of the volunteer company to positions in the 23rd Regiment of Ohio Volunteer Infantry. Hayes was promoted to major, and his friend and college classmate Stanley Matthews was appointed lieutenant colonel.[49] Joining the regiment as a private was another future president, William McKinley.[49]
After a month of training, Hayes and the 23rd Ohio set out for western Virginia in July 1861 as a part of the Kanawha Division.[50] They did not meet the enemy until September, when the regiment encountered Confederates at Carnifex Ferry in present-day West Virginia and drove them back.[51] In November, Hayes was promoted to lieutenant colonel (Matthews having been promoted to colonel of another regiment) and led his troops deeper into western Virginia, where they entered winter quarters.[52] The division resumed its advance the following spring, and Hayes led several raids against the rebel forces, on one of which he sustained a minor injury to his knee.[53] That September, Hayes's regiment was called east to reinforce General John Pope's Army of Virginia at the Second Battle of Bull Run.