During the Nazi years, he investigated methods to study arteries using freshy executed victims of the third reich.
In 1937 the institute where he worked was destroyed during the Second Sino-Japanese War and Hayek fled into interior China.
At the end of year he received a position at the University of Würzburg but he was able to leave China only in 1938.
He worked on various anatomical topics including physical anthropology research with studies of Chinese frontal lobes.
Hayek taught at Würzburg and served as an interim director in 1939-40 when Hans Petersen (1885–1946) was away.
In August 1945 the allied forces dismissed him from his position based on his membership in the NSDAP.