The end of the war in 1783 meant that the "Barrington" was paid off and Cunningham retired from active naval life. He returned to service in 1788 when he joined Admiral Sir William Cornwallis' flagship . He served for several years in the East Indies, before being promoted to commander and given command of the 16-gun sloop . He then returned to Britain. He arrived after the outbreak of war with France, and was quickly appointed to the 14-gun . He then joined Lord Hood's fleet in the Mediterranean, arriving there in April 1793. He was largely employed in carrying despatches and maintaining communications with other ships scattered throughout the Mediterranean ports. On 5 October 1793 the "Speedy" accompanied and into Genoa, where they captured a French frigate, the "Modeste" and two armed tartanes. The "Captain" and "Speedy" then sailed to the Gulf of Spezia where they caught another French frigate, the "Imperieuse" at anchor. The "Imperieuse" scuttled herself, but was subsequently salvaged and recommissioned as HMS "Imperieuse". Cunningham was promoted to captain and given command of the prize, with his commission post-dated to the date of the capture, 12 October 1793.