On the receipt of news of the resumption of war with France, the EIC appointed Hayes commodore of a small squadron consisting of Bombay, Mornington (22 guns), Teignmouth (16), and the armed vessel Castlereagh (16), and charged him with protecting the trade routes in the Bay of Bengal and adjacent waters.
After three days of bombardment by Bombay and Castlereagh, Hayes landed at the head of a party of seamen and took the fort and adjacent batteries, which the British dismantled.
In January 1804 she was at Canton and she sailed with the homeward bound China Fleet, which by the time it reached the approaches to the Strait of Malacca had swelled to include 16 East Indiamen, 11 country ships, a Portuguese merchant ship from Macau and a vessel from Botany Bay in New South Wales.
On 14 February 1804, with the island of Pulo Aura within sight to the south-west near the eastern entrance to the Straits of Malacca, the China Fleet encountered a powerful French squadron under the command of Contre-Admiral Charles-Alexandre Durand Linois.
She left Bombay on 15 September 1804, sailed through the Straits of Malacca to Manila, and arrived at Whampoa anchorage on 4 November.
She left after four days and arrived at the Sand Heads on 13 February 1805, having made the round voyage in under four months.
[5] In late 1810 Lord Castlereagh was one of the transport vessels that supported the British invasion of Île de France.
She had left the Portsmouth on 14 May and had she not encountered light winds after reaching Anjouan would have made the voyage in 80 days.
She arrived safely in Macao having struggled through the monsoon in the Bay of Bengal and a typhoon in the China Sea.