Following the outbreak of the Second World War the battalion held a number of training exercises and camps at Yeppoon until 1941, as the Militia battalions were tasked with improving the nation's readiness for war. During this time the battalion was commanded by Lieutenant Colonel Alexander Heron, who had taken up command of the battalion in January 1940. In March 1942, as the threat posed by the Japanese in the Pacific grew, the battalion was mobilised for full-time service and moved to Tiaro. There, it concentrated with the 15th and 47th Battalions to form the 29th Brigade, 5th Division. In early 1942, the 29th Brigade moved to Townsville and was tasked with preparing defensive positions between Giru and Rollingstone in case of a Japanese invasion. It later conducted jungle warfare training at Mount Spec, near Townsville. Lieutenant Colonel Charles Davidson took over as commanding officer in September 1942. In January 1943, the brigade was deployed to Milne Bay in New Guinea to take part in operations against the Japanese. The battalion subsequently moved to Buna and Boisi in mid-July, before moving again to Morobe. In August, the 42nd Battalion moved to Nassau Bay, then redeployed to Tambu Bay, fighting during the Salamaua–Lae campaign around Mount Tambu. On 9 September, it secured Charlie Hill, subsequently allowing the capture of Salamaua three days later. In early 1944, the 29th Brigade was involved in clearing the Japanese from Lae alongside the 7th Division. In August, the battalion returned to Australia after 18 months on operations, encamping at Young's Crossing in Petrie, Queensland, for reorganisation after a period of leave. Lieutenant Colonel Joseph Byrne took over as commanding officer in September 1944.