When the Second World War broke out, Shaw enlisted on 8 July 1940 in the 2/12 Field Company, Royal Australian Engineers. As part of the 8th Division in the Second Australian Imperial Force, Shaw was sent over in February 1941 to Malaya to assist in the defence of Singapore. He surrendered along with all allied forces in Malaya on 31 January 1942 and was taken prisoner, being held in the notorious Changi Prison. Liberated at the end of the war, he was discharged on 24 January 1946 with the rank of major. On 6 March 1947 for "Organisation, courage and coolness in Malaya" he was awarded the Distinguished Service Order (DSO). He was presented with his award by the Governor-General of Australia, Sir William McKell, on 24 January 1949 at Admiralty House, Sydney.