Useful script for MSVC users …

I wrote a little .cmd script (for the NT script interpreter, cmd.exe) that can be used to get the environment for the newest, or a specified installed version of Visual C++, similar to what the link from the start menu does. Only this one does not hardcode anything but instead uses the registry to find out the paths.

setvcvars.cmd is released into the PUBLIC DOMAIN and the disclaimer is included in the file itself.

Prerequisite:
reg.exe, which is included in Windows XP and available for NT4 and 2000 through the respective Resource Kits.

Syntax:
setvcvars.cmd [msvc-version]

As you can see the version argument is optional. It carries the “true” version number of the Visual C++ you want to get the environment for. This would be “7.0” for Microsoft Visual C++ .NET, “7.1” for Microsoft Visual C++ .NET 2003, “8.0” for Microsoft Visual C++ 2005 and “9.0” for Microsoft Visual C++ 2008.

// Oliver

PS: Some of the techniques were already demonstrated in ddkbuild.cmd before.

This entry was posted in /dev/null, EN, Programming. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *