from his birth until the death of his father in 1806 to distinguish him from William V. Like his younger brother Prince Frederick of Orange-Nassau he was tutored by the Swiss mathematician Leonhard Euler and the Dutch historian Herman Tollius. They were both tutored in the military arts by general Prince Frederick Stamford. After the Patriot revolt had been suppressed in 1787, he in 1788–89 attended the military academy in Brunswick which was considered an excellent military school, together with his brother. In 1790 he visited a number of foreign courts like the one in Nassau and the Prussian capital Berlin, where he first met his future wife. William subsequently studied briefly at the University of Leiden. In 1790 he was appointed a general of infantry in the States Army of which his father was Captain general, and he was made a member of the Council of State of the Netherlands. In November 1791 he took his new bride to The Hague. After the National Convention of the French First Republic had declared war on the stadtholder of the Dutch Republic in February 1793, William was appointed commander-in-chief of the veldleger (mobile army) of the States Army (his father remained the nominal head of the armed forces). As such he commanded the troops that took part in the Flanders Campaign of 1793–95. He took part in the battles of Veurne and Menin (where his brother was wounded) in 1793, and commanded during the siege of Landrecies (1794), whose fortress surrendered to him. In May 1794 he had replaced general Kaunitz as commander of the combined Austro-Dutch forces on the instigation of Emperor Francis II who apparently had a high opinion of him. William was vicorious at the Battles of Gosselies and Lambusart, but the French armies ultimately proved too strong, and the allied leadership too inept, and thus the allies were finally defeated at the Battle of Fleurus (1794). The French first entered Dutch Brabant which they dominated after the Battle of Boxtel. When in the winter of 1794–95 the rivers in the Rhine delta froze over, the French breached the southern Hollandic Water Line and the situation became militarily untenable. In many places Dutch revolutionaries took over the local government. After the Batavian Revolution in Amsterdam on 18 January 1795 the stadtholder decided to flee to Britain, and his sons accompanied him. (On this last day in Holland his