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."
The advantages of using batch files are the ease of writing them, the ability to edit the files without compiling anything, their cross-compatibility across Windows NT Operating Systems and their inherent ability to manipulate file systems due to their basis on MS-DOS.
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.
you need devenv.exe to be present at location where your compile.bat is running. Please look at solution given here-
Simply type devenv.exe from the command line. If you get a message like this, then you do not have devenv.exe in your path. >>> 'devenv.exe' is not recognized as an internal or external command, operable program or batch file. >>> To fix this simply run the batch file, vsvars32.bat that comes with Visual Studio.NET from the command line in the working folder. After you run this batch file devenv.exe will be available from the command line in that folder.
http://windowsclient.net/blogs/faqs/archive/2006/05/26/how-do-i-start-visual-studio-from-the-command-line.aspx
I would usually copy the devenv.exe manually to the location where my bat file is kept.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With