I have created a compile.bat and run.bat files, but when I double click on them they run on the Windows cmd prompt instead of the VS cmd prompt.
This is what I have in my compile.bat file:
devenv FileMgr.sln /rebuild debug
pause
The Windows cmd says “‘devenv is not recognized as an internal or external command, operable program or batch file.”
If I recall correctly, all the Visual Studio Command Prompt is is a batch script itself that initializes paths and environment variables. So if you simply call that batch script at the top of yours, you’ll have all those settings for your script.
According to this question, MSVC 2008 has that batch file here:
call “C:\Program Files\Microsoft Visual Studio 2008\VC\vcvarsall.bat
It may not be in exactly the same place, but it should be something similar on your machine.