What's the difference between:
VsDevCmd.bat
(Developer Command Prompt for VS2012)vcvarsall.bat
(VS2012 x86\x64\ARM Native\Cross Tools Command Prompt)I have a pretty good understanding of vcvarsall.bat
as it's been part of Visual Studio for many previous versions. vcvarsall.bat
was basically my goto tool for MsBuild even when building .NET projects even though it's technically part of Visual C++.
What I don't have a good understanding of is VsDevCmd.bat
. It seems to be new with VS2012 and I'm not sure what it's purpose is. I've noticed it's not in the Visual C++ folder like vcvarsall.bat
but it's in the Visual Studio Tools folder. Should I be doing doing my .NET msbuilds in this tool now? If so how do I setup the same kinds of x64\x86\ARM defaults like the vcvarsall.bat
?
VsDevCmd. bat sets the Visual Studio related environment variables that are necessary for compiling, linking and building applications on the command line.
Search for the name of the command prompt file, which is VsDevCmd. bat, or go to the Tools folder for Visual Studio, such as %ProgramFiles(x86)%\Microsoft Visual Studio\2019\Community\Common7\Tools (path changes according to your Visual Studio version, edition, and installation location).
Developer Command Prompt - Sets the environment to use 32-bit, x86-native tools to build 32-bit, x86-native code. 2. x86 Native Tools Command Prompt - Sets the environment to use 32-bit, x86-native tools to build 32-bit, x86-native code. These two options have different names, but the same annotations.
To access these command prompts on Windows, on the Start menu, open the folder for your version of Visual Studio, and then choose one of the x64 native or cross-tool developer command prompts.
From my understanding and looking at the various batch scripts in VS2012:
vcvarsall.bat called with x86 (or just vcvarsall.bat with no option, which defaults to x86) is identical to the VsDevCmd.bat. The batch file that vcvarsall.bat calls when passed with the x86 option is
C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\vcvars32.bat
This file is identical to the VsDevCmd.bat file that is located in
C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\Tools\VsDevCmd.bat
which is what the developer command prompt calls when opened from the start menu.
Thus for more control on the platform it is better to call vcvarsall.bat with the appropriate option passed: x86 or amd64 or arm or x86_amd64 or x86_arm.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With