In 1810, he sailed to South Africa to become Commander-in-Chief of the Cape of Good Hope Station. He directed the operations that resulted in the capture of Java when on 8 August 1811, the Dutch settlement of Batavia capitulated to the British under Stopford and Lieutenant-General Sir Samuel Auchmuty. The British fleet consisted of some 100 vessels, including eight cruisers belonging to the East India Company. He was appointed Commander-in-Chief, Portsmouth in 1827.