In 1680 he attended a Jesuit college in Warsaw, then one in Braniewo. He participated in the campaign against Turkey of Emperor Leopold I in 1690, and then after the Moldovan expedition of Jan Sobieski, returned to the Polish–Lithuanian Commonwealth in 1691. In the spring of 1692 he was promoted to Major General in the Austrian army and in the years 1693–1694 fought in further wars against the Ottomans as head of the 47th Styrian Infantry Regiment. He participated in the Siege of Belgrade in 1693.