VsDevCmd.bat
(which extends the functionality of vsvars32.bat
of earlier Visual Studio versions). VsDevCmd.bat
is located can be determined with vswhere.exe
, which is (by default) located under C:\Program Files (x86)\Microsoft Visual Studio\Installer
: C:\> "%programfiles(x86)%\Microsoft Visual Studio\Installer\vswhere" -latest -property installationPath C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
C:\> for /f "usebackq delims=#" %a in (`"%programfiles(x86)%\Microsoft Visual Studio\Installer\vswhere" -latest -property installationPath`) do "%a\Common7\Tools\VsDevCmd.bat" ********************************************************************** ** Visual Studio 2017 Developer Command Prompt v15.9.7 ** Copyright (c) 2017 Microsoft Corporation **********************************************************************
vsenv.bat
that does exactly this. VsDevCmd.bat
among others also sets the VSxxxCOMNTOOLS
environment variable. vsvars32.bat
is not under …\Common7\Tools
anymore, there is vcvars32.bat
(and vcvars64.bat
and a few other batch files) under Installation-root\VC\Auxiliiary\Build
. (Note: these batch files begin with with vcvars…
, not with vsvars…
!) C:\> for /f "usebackq delims=#" %a in (`"%programfiles(x86)%\Microsoft Visual Studio\Installer\vswhere" -latest -property installationPath`) do "%a\VC\Auxiliary\Build\vcvars32.bat" ********************************************************************** ** Visual Studio 2017 Developer Command Prompt v15.9.7 ** Copyright (c) 2017 Microsoft Corporation ********************************************************************** [vcvarsall.bat] Environment initialized for: 'x86'
vsenv.bat
batch file. %VSxxxCOMNTOOLS%
with which it was possible to set the environment variables. The xxx
refers to the Visual Studio version (without dots), for example 100
, thus the variable being %VS100COMNTOOLS%
. The value of the variable points to the Commont7\Tools
directory under the respective installation root. %VSxxxCOMNTOOLS%
, it's possible to locate and run vsvars32.bat
, a batch file that sets the necessary environment variables. C:\> "%VS100COMNTOOLS%\vsvars32.bat" Setting environment for using Microsoft Visual Studio 2010 x86 tools.
VsDevCmd.bat
etc.) modify and add the following environment variables: %PATH%
%VCToolsInstallDir%\bin\HostX{86\x86,64\x64}
%VCIDEInstallDir%\VCPackages
%DevEnvDir%\CommonExtensions\Microsoft\TestWindow
%DevEnvDir%\CommonExtensions\Microsoft\TeamFoundation\Team Explorer
%VSINSTALLDIR%\MSBuild\15.0\bin
%VSINSTALLDIR%\MSBuild\15.0\bin\Roslyn
%VSINSTALLDIR%\Team Tools\Performance Tools
%VSINSTALLDIR%\Team Tools\Performance Tools\x64
(Only in 64 bit environment)
C:\Program Files (x86)\Microsoft Visual Studio\Shared\Common\VSPerfCollectionTools\
C:\Program Files (x86)\Microsoft Visual Studio\Shared\Common\VSPerfCollectionTools\x64
(Only in 64 bit environment)
%WindowsSDK_ExecutablePath_x86%\
(x64 ?)
%WindowsSdkVerBinPath%x{86,64}
%WindowsSdkDir%\bin\x{86,64}
C:\Windows\Microsoft.NET\Framework{,64}\v4.0.30319
%DevEnvDir%
%VSxxxCOMNTOOLS%
__VSCMD_PREINIT_PATH
variable contains the value of %PATH%
it had prior to adding the Visual Studio variables.
%INCLUDE%
variable: %VCToolsInstallDir%\ATLMFC\include
%VCToolsInstallDir%\include
%WindowsSdkDir%\NETFXSDK\4.6.1\include\um
%UniversalCRTSdkDir%/Include/%UCRTVersion%\ucrt
%UniversalCRTSdkDir%/Include/%UCRTVersion%\shared
%UniversalCRTSdkDir%/Include/%UCRTVersion%\um
%UniversalCRTSdkDir%/Include/%UCRTVersion%\winrt
%UniversalCRTSdkDir%/Include/%UCRTVersion%\cppwinrt
INCLUDE
directories are not dependent on the 86,64 environment. LIB
variable: %VCToolsInstallDir%\ATLMFC\lib\{x86,x64}
v\lib\{x86,x64}
C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\lib\um\{x86,x64}
%WindowsSdkDir%\lib\%UCRTVersion%\ucrt\{x86,x64}
%WindowsSdkDir%\lib\%UCRTVersion%\um\{x86,x64}
LIBPATH
variable: %VCToolsInstallDir%\ATLMFC\lib\{x86,x64}
%VCToolsInstallDir%\lib\{x86,x64}
%VCToolsInstallDir%\lib\x86\store\references
(No difference in 86 and 64 environment. Error in batch file? )
%WindowsSdkDir%\UnionMetadata\%UCRTVersion%
%WindowsSdkDir%\References\%UCRTVersion%
%SystemRoot%\Microsoft.NET\Framework{,64}\%FrameworkVersion%
(Note: 86 environment without 86 in path name.)
Variable | Possible value | Comment |
VSINSTALLDIR | C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\ | The Visual Studio installation root-directory. Note the similarity to %VCINSTALLDIR% |
VCINSTALLDIR | %VSINSTALLDIR%VC\ | The VC directory below %VSINSTALLDIR% , it contains the C and C++ specific parts of a Visual Studio installation. |
VSxxxCOMNTOOLS | %VSINSTALLDIR%Common7\Tools\ | xxx corresponds to %VisualStudioVersion% without dot. |
DevEnvDir | %VSINSTALLDIR%Common7\IDE\ | Contains Visual Studio IDE related exes etc, such as devenv.exe . |
VCIDEInstallDir | %DevEnvDir%VC | |
VCToolsInstallDir | %VCINSTALLDIR%Tools\MSVC\%VCToolsVersion%\ | |
VCToolsRedistDir | %VCINSTALLDIR%Redist\MSVC \x.y.z | |
FrameworkDir32 | C:\Windows\Microsoft.NET\Framework\ | The location of the .NET Framework |
FrameworkDir64 | C:\Windows\Microsoft.NET\Framework64\ | The location of the .NET Framework |
UniversalCRTSdkDir | C:\Program Files (x86)\Windows Kits\10\ | |
WindowsSdkDir | C:\Program Files (x86)\Windows Kits\10\ | Contains include files like <windows.h> under %UniversalCRTSdkDir%\Include\%UCRTVersion%\um or <stdio.h> under %UniversalCRTSdkDir%\Include\%UCRTVersion%\ucrt |
WindowsSdkBinPath | %WindowsSdkDir%bin | |
WindowsSdkVerBinPath | %WindowsSdkDir%bin\%WindowsSDKVersion%\ | |
WindowsLibPath | %WindowsSdkDir%\UnionMetadata\10.0.17763.0;%WindowsSdkDir%\References\10.0.17763.0 | |
ExtensionSdkDir | C:\Program Files (x86)\Microsoft SDKs\Windows Kits\10\ExtensionSDKs | |
WindowsSDK_ExecutablePath_x64 | C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools\x64\ | |
WindowsSDK_ExecutablePath_x86 | C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools\ |
Variable name | Possible value |
Framework40Version | v4.0 |
FrameworkVersion | v4.0.30319 |
FrameworkVersion32 | v4.0.30319 |
FrameworkVersion64 | v4.0.30319 |
UCRTVersion | 10.0.17763.0 |
VSCMD_VER | 15.9.7 |
VisualStudioVersion | 15.0 |
VCToolsVersion | 14.16.27023 |
WindowsSDKVersion | 10.0.17763.0\ |
WindowsSDKLibVersion | 10.0.17763.0\ |
%FrameworkVersion%
variables seem to be used to locate the %SystemRoot%\Microsoft.NET\Framework64\%FrameWorkVersion64%
directory. Variable | env 32 value | env 64 value |
Platform | x86 | x64 |
FrameworkDir | C:\Windows\Microsoft.NET\Framework\ | C:\Windows\Microsoft.NET\Framework64\ |
VSCMD_ARG_HOST_ARCH | x86 | x64 |
VSCMD_ARG_TGT_ARCH | x86 | x64 |
__DOTNET_PREFERRED_BITNESS | 32 | 64 |
__DOTNET_ADD_32BIT | 1 | n/a |
__DOTNET_ADD_64BIT | n/a | 1 |
Variable name | Possible value |
CommandPromptType | Native |
VSCMD_ARG_app_plat | Desktop |