He commanded an autonomous corps in the 1799 campaign in southwestern Germany, with which he protected the main Austrian army's right (northern) flank as it advanced across Swabia. At the first action of this campaign, the Battle of Ostrach, he led 10,000 men across Swabia, covering the northernmost flank of the Austrian and Imperial army. Subsequently, his troops guarded the Neckar valley. At the Battle of Wiesloch, (3 December), he drove the French from the right bank of the Rhine and relieved Philippsburg fortress. After the Austrian defeat at Battle of Hohenlinden on 3 December 1800, Sztáray was given the task of raising the Bohemian-Moravian Legion. In 1801 he was appointed Commanding General in Inner Austria. He was promoted to the rank of "Feldzeugmeister", or commanding general of campaign, on 6 March 1800; he retired after the 1805 campaign against France. He received the Knights Cross of the Military Order of Maria Theresa on 21 December 1789, and the Commanders Cross on 18 September 1796. He was the Colonel and Proprietor of the 33rd Infantry Regiment (Austria) from 1791 until his death on 23 January 1808.