He was ordered to the Cape in August 1796 after the first British occupation to become major-general and commander of the forces in May 1797.
He first acted as governor from 21 November 1798 to 9 December 1799 and again from 20 April 1801 to 20 February 1803, when the Colony was returned to the Batavian Republic in accordance with the Treaty of Amiens signed on 27 March 1802.
He commanded the Kent division of the army collected on the south coast of England under Sir David Dundas during part of the invasion alarms of 1804–5.
(Foster's Peerage under Melville) He was promoted full general on 1 January 1812 and made Colonel of the 71st (Glasgow Highland Light Infantry) Regiment of Foot from 1809.
[3] He died at his house, 11 Shandwick Place,[4] just west of Princes Street in Edinburgh on 4 January 1824.