Search notes:

VsDevCmd.bat

VsDevCmd.bat sets the Visual Studio related environment variables that are necessary for compiling, linking and building applications on the command line.
VsDevCmd.bat is new with Visual Studio 2017 and replaces vsvars32.bat that came with Visual Sutido 2015 and earlier version.
vsvars32.bat was (by default) located under C:\Program Files (x86)\Microsoft Visual Studio V.w\Common7\Tools.
When invoked with no parameters, the script sets the environment and the host and target build architecture to use the 32-bit x86-native tols to build 321-bit x86 code.

-arch=

-arch= allows to set the architecture for the produced binaries. It might be set, for example, like so:
VsDevCmd -arch=amd64
VsDevCmd -arch=x86
-arch=x86 is the default if not specified.

-host_arch=

-host_arch= sets the architecture of the compiler. It allows the same values as -arch.

-winsdk=

Specifies the Windows SDK version.

-vcvars_vers=

The -vsvars_vers option specifies the version of the VC++ toolset.
If not specified, the value from Microsoft.VCRedistVersion.default.txt will be chosen.

Debugging execution

The value of the environment variable VSCMD_DEBUG determines the level of debugging. It can be set to
1 Basic debugging
2 Detailed debugging
3 Trace level debugging (redirection of output to file recommended)
C:\> set VSCMD_DEBUG=3
C:\> … VSDevCmd.bat
If the value is not set at all, no debugging takes place.

TODO

How does VsDevCmd.bat relate to vcvarsall.bat?

See also

vsenv.bat is a batch file that finds the location of VsDevCmd.bat and invokes it.

Index