War with France
Cole remained in the East Indies for the next four years, moving from Crown to HMS Minerva under Cornwallis and in June 1793 becoming an acting lieutenant aboard HMS Bien Aime under Captain Richard King. In September 1793, more than four years after passing his examinations, Cole was finally promoted to lieutenant and the following year joined HMS Cerberus off Ireland under Captain John Drew, at the direct order of Lord Chatham who ensured that Cole was the most senior lieutenant aboard despite his recent promotion. In June 1795, Cole moved to HMS Sans Pareil in the West Indies under Captain Lord Hugh Seymour and in 1799 took part in the invasion of Surinam, for which service Seymour awarded him promotion to commander in the prize ship HMS Surinam.
During his time in command of Surinam, Cole achieved a number of successful cruises, including the capture of two privateers and the recapture of a merchant schooner in March 1800, and introduced new regulations aboard his ship that kept his men in good health in the Caribbean Sea. In 1801, Seymour died from a fever, but Cole's activities had already been noticed by Sir John Thomas Duckworth who replaced Seymour and Cole was made a post captain on 30 June 1801 in Duckworth's flagship HMS Leviathan, followed by command of the frigate HMS Southampton the following year. Shortly after taking command of Southampton the Peace of Amiens brought the Revolutionary Wars to an end and the frigate was paid off.
Within a year the Napoleonic Wars had begun, and Cole was returned to active service, chosen by Pellew, now a rear-admiral, to command his flagship HMS Culloden. Pellew was sent out to the Indian Ocean in 1804, and Cole remained with him there for three years, participating in the Java campaign of 1806–1807. The stress of service in the Far East caused the relationship between the two men to break down, and in March 1807 Cole took command of the new frigate HMS Doris. In 1808, Doris was detached from Pellew's command to escort a diplomatic mission under John Malcolm to Fath Ali Shah, the ruler of Persia. Throughout the mission, Cole remained at Bushire in the Persian Gulf and was rewarded for his service with the thanks of the Governor General of India and a £500 award, but his conduct was publicly criticised by Pellew.
Following Pellew's replacement by Rear-Admiral William O'Bryen Drury, Doris was sent to serve in the Strait of Malacca, on a mission to obtain a working relationship with the Spanish government in the Philippines. For his successful efforts he was given command of the frigate HMS Caroline in 1809 and the following year was given command of a squadron with which to attack the Molucca Islands on a free commission. Sailing to the well-defended island of Banda Neira, Cole planned an audacious attack on 10 August 1810, his troops storming the fortress and successfully capturing it. The following year he took a leading role in the planning of the invasion of Java, which was successfully completed under Rear-Admiral Robert Stopford. For his services, he was knighted in May 1812, awarded a specially minted medal and given an honorary doctorate by the University of Oxford.
In 1813, Cole returned to Europe and took command of the ship of the line HMS Rippon in the Channel Fleet. In October 1813 he captured the damaged French frigate Weser, and in February 1814 he recaptured an extremely valuable Spanish treasure ship previously seized by a French warship. On 1 September 1814, Rippon was decommissioned and Cole's career at sea came to an end after 34 years on continual service.