Born in Martinsburg, Virginia (now West Virginia), Shanks pursued an academic course. He studied law and was admitted to the bar in 1848 and commenced practice in Portland, Indiana, in 1849. He served as prosecuting attorney of Jay County in 1850 and 1851 and served as member of the State house of representatives in 1855.
Shanks was elected as a Republican to the Thirty-seventh Congress (March 4, 1861 – March 3, 1863). He was an unsuccessful candidate for reelection in 1862 to the Thirty-eighth Congress.
On December 3, 1867, President Andrew Johnson nominated Shanks for appointment to the grade of brevet major general of volunteers, to rank from March 13, 1865, and the United States Senate confirmed the appointment on February 14, 1868.[3]
Shanks was elected to the Fortieth and to the three succeeding Congresses (March 4, 1867 – March 3, 1875) and served as chairman of the Committee on Militia (Forty-first Congress) and the Committee on Indian Affairs (Forty-second Congress).
Shanks was an unsuccessful candidate for renomination in 1874. He resumed the practice of his profession. He was again a member of the State house of representatives in 1879.
Shanks died in Portland, Indiana, January 23, 1901 and was interred in Green Park Cemetery.