|Important||This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer|
Setting the Path and Environment Variables for Command-Line Builds
The vcvars32.bat file sets the appropriate environment variables to enable 32-bit command-line builds. For information on how to enable a 64-bit toolset at the command line, see.
Note that if you are doing command-line builds with DEVENV, vcvars32 settings will have no affect on your builds, unless you also specify the /useenv option.
To run vcvars32.bat
At the command prompt, change to the \bin subdirectory of your Visual C++ installation.
Run vcvars32.bat by typing VCVARS32.
The vcvars32.bat file can vary from computer to computer. Do not replace a missing or damaged vcvars32.bat file with a vcvars32.bat from another computer. Rerun Visual C++ Setup to replace the missing file.
For more information about vcvars32.bat, see the following Knowledge Base article:
Q248802 : Vcvars32.bat Generates Out of Environment Message
If the current version of Visual C++ is installed on a computer that also has a previous version of Visual C++, you should not run vcvars32.bat from different versions in the same command window.
CL.exe invokes the preprocessor and compiler, and LINK.exe invokes the linker. (CL can invoke the linker as well, so you do not have to invoke LINK directly in most cases.)
CL.exe, LINK.exe, and other command-line tools require that certain environment variables be properly set: