Farley returned to Coast Guard Headquarters in March 1937 and was assigned duties as chief communications officer. He made several trips to conferences and meetings during this period including one in Cairo, Egypt during February and March 1938, one at Montreux, Switzerland in March 1939 and another in Krakow, Poland in May 1939. He also served as a member of the coordinating committee of the Defense Communications Board. On 1 December 1941 Farley was promoted to the rank of captain. From June 1942 to December 1943 he served as District Coast Guard Officer of the Eighth Coast Guard District based at New Orleans, Louisiana. He was awarded the Legion of Merit for his service as District Officer and on 1 June 1943 he was promoted to commodore. Farley was reassigned to Coast Guard Headquarters in December 1943 as Assistant Chief Operations Officer until December 1944 when he assumed the assignment of Chief Personnel Officer. He was nominated by President Harry S. Truman and confirmed by the Senate to be Commandant of the Coast Guard succeeding Admiral Russell R. Waesche. Farley assumed the duties of the office 1 January 1946, the same day he was promoted to admiral.