He left Niger at the end of the Napoleonic Wars and did not receive another command until 1831 when he was given the 120-gun ship of the line HMS Britannia, in which he served in the Mediterranean Fleet until 1835.
[1][2][3] Rainier joined the Royal Navy in August 1795 in the ship of the line HMS Pompee, commanded by his uncle Captain James Vashon.
[11] He continued to serve on the East Indies Station and was very successful in Caroline during the Java campaign of 1806–1807, fighting the action of 18 October 1806; Rainier had been patrolling off Batavia when he captured a small Dutch brig, the crew of which informed him that the Dutch 36-gun frigate Phoenix was making repairs at Onroost Island nearby and was vulnerable to attack.
From the crew of Zeerop Rainier learned that another Dutch frigate, the 36-gun Maria Reijersbergen, was also at Batavia along with some smaller warships, the 20-gun William, 18-gun Patriot, and 14-gun Zeephlong.
The battle between the two frigates finished in very shallow water surrounded by dangerous shoals and so Rainier was not safely able to attack the other Dutch warships.
Despite this inability to continue attacking, the remaining vessels, including the frigate Phoenix, ran themselves aground to avoid the fate of Maria Reijersbergen.
[12] Rainier brought the Dutch frigate away from Batavia before anchoring, having suffered twenty-two casualties compared to Maria Reijersbergen's fifty.
[15] Despite the action being highly acclaimed, Rainier was not rewarded by the navy for it; it has been suggested that this was because of a combination of his young age (twenty-two at the time) and as a form of censure for how he had been so quickly promoted through his uncle's nepotism.
[3] He had left the East Indies in 1805 and one of his replacements as commander-in-chief was Rear-Admiral Sir Edward Pellew, who in November 1806 had finished off the job Rainier had started at Batavia in October by destroying Phoenix, William, Patriot, Zeephlong, and their smaller consorts.
Using this information Pellew would go on to destroy them in the Raid on Griesse in December, but by this point Rainier had left Caroline, going home to England suffering from a probable fever.
Poor weather meant Rainier was unable to find the French, but in November he captured the American 16-gun letter of marque Dart as she attempted to cross the Atlantic from New Orleans to France.
[2] He worked with his brother-in-law, Lieutenant-Colonel Henry Bowler, to record objects he discovered for the Royal Asiatic Society, and in 1833 they presented their findings on an engraved stone and avenue of sphinxes found by Rainier at the Temple of Kalabsha and Beni Hasan respectively in 1828 and 1829, when he travelled there while between commands.