Visual-studio – Adding Native Tools Command Prompt on VS2015 RC

cmdcommand-promptenvironment-variablesvisual studiovisual-studio-2015

Since I cannot locate Native Tools CMD under the Tools menu, I try to manually add it in External Tools. Few questions:

  1. Regardless of what I choose for Command (ARM, x86 or x64 etc.), Command is always C:\Windows\System32\cmd.exe. Why the different CMDs end up having the same path to the native System32's CMD?
  2. Referring to this answer, I should insert /k "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\VsDevCmd.bat" to the arguments – what is the /k and what is the bat for this argument? Why do I need to pass a path as an argument to the command prompt?
  3. What is Initial Directory?

Screenshot

Best Answer

Why the different CMDs end up having the same path to the native System32's CMD?

The VS2015* CMDs are just cmd.exe with some environment variables already set up for you. so for example instead of typing "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\InstallUtil.exe" to run InstallUtil.exe you will just type InstallUtil and it will work. if you didn't set up the environment variables you will get an error message saying that 'installutil' is not recognized as an internal or external command, operable program or batch file.

what is the /k and what is the bat for this argument? Why do I need to pass a path as an argument to the command prompt?

/k is a parameter for cmd.exe and what it does is run the commands specified by the string that follows (in this case it will execute what's inside "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\VsDevCmd.bat" and will carry out).

What is Initial Directory?

Initial directory is used to specify the working directory that your cmd.exe instance will start in

So in the end you'll have something like this for Visual Studio 2015:

enter image description here

The "arguments" for VS2015 is :

/k "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\VsDevCmd.bat"