<p>Visual Studio 2003 and 2005 (and perhaps 2008 for all I know) require the command line user to run in the 'Visual Studio Command Prompt'.  When starting this command prompt it sets various environment variables that the C++ compiler, cl, uses when compiling.</p>

<p>This is not always desirable.  If, for example, I want to run 'cl' from within Ant, I'd like to avoid having to run Ant from within the 'Visual Studio Command Prompt'.  Running vcvars32.bat isn't an option as the environment set by vcvars32.bat would be lost by the time cl was run (if running from within Ant).</p>

<p>Is there an easy way to run cl without having to run from within the Visual Studio command prompt?</p>

You can simply run the batch file which sets the variables yourself. In VS08 it's located at:-
```
```
C:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat
```
```