Even better - by Zackary Geers This works slightly better then my previous version, it figures out the framework directory on the fly. for /D %%d in (%systemroot%\Microsoft.NET\Framework\v4.0.*) do %%d\aspnet_compiler -v / -p "$(ProjectDir)\" Read the article