--- a/src/hugin_base/algorithms/panorama_makefile/PanoramaMakefilelibExport.cpp
+++ b/src/hugin_base/algorithms/panorama_makefile/PanoramaMakefilelibExport.cpp
@@ -121,7 +121,7 @@
 
 #ifdef _WINDOWS
     mgr.own_add(new Comment("Force using cmd.exe"));
-    mf::Variable* winshell = mgr.own(new mf::Variable("SHELL", getenv("ComSpec"), Makefile::NONE));
+    mf::Variable* winshell = mgr.own(new mf::Variable("SHELL", std::string(getenv("SystemRoot"))+"\\system32\\cmd.exe", Makefile::NONE));
     winshell->getDef().add();
 #endif