In 1850 he served as adjudant to then Adjutant General to Fielmarshal Radetzky, after which he was named Colonel and Commander of Infantry Regiment No. 23. On September 25, 1854, Hartung was promoted major general and appointed command of a brigade in the 2nd Army Corps. In 1859 he and his brigade took part in the war against France and Piedmont. As part of the 3rd Army Corps they fought at Magenta and Solferino.