Reputation: 5366
If you double click on a .bat file, windows will run it in a command prompt.
I want a specific .bat file to be launched using the .Net command prompt as it uses gacutil.
How can I achieve this?
thanks!
Upvotes: 5
Views: 2035
Reputation: 18290
The compilers can be used from command line (or makefiles) just like any other compilers. The main things you need to take care of are the INCLUDE and LIB environment variables, and PATH. If you're running from cmd.exe, you can just run this .bat to set the environment:
C:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat
follow these links for more information: Using Visual Studio's 'cl' from a normal command line
How to create a Batch File for Visual Studio Command Prompt
Upvotes: 1
Reputation: 46585
If you put this line at the top of your bat file, it will set the environment variables for the visual studio command prompt
"C:\Program Files\Microsoft Visual Studio 10.0\VC\vcvarsall.bat"
You may need to adjust for your version of VS and if you're on a 64bit machine.
Upvotes: 2