 Townley joined the Royal Australian Navy in September 1940, and in February 1941, he was sent to England to train in bomb- and mine-disposal work.He returned to Australia and commanded the 35 ton patrol boat "HMAS Steady Hour", which assisted in destroying a Japanese midget submarine during the attack on Sydney Harbour in June 1942.He was put in command of the Fairmile B motor launch ML817 in January 1943, promoted to acting lieutenant commander in March and was involved in the New Guinea campaign.