在 VS2015 RC 上添加本机工具命令提示符

Adding Native Tools Command Prompt on VS2015 RC

由于无法在 Tools 菜单下找到 Native Tools CMD,我尝试在 External Tools 中手动添加它。几个问题:

  1. 无论我为 Command 选择什么(ARM、x86 或 x64 等),Command 总是 C:\Windows\System32\cmd.exe.为什么不同的 CMD 最终具有相同的路径到本机 System32 的 CMD?
  2. 关于 this answer,我应该在参数中插入 /k "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\VsDevCmd.bat" - 这个参数的 /k 是什么,bat 是什么?为什么我需要将路径作为参数传递给命令提示符?
  3. 什么是初始目录

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

VS2015* CMD 只是 cmd.exe 已经为您设置了一些环境变量。因此,例如,不用键入 "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\InstallUtil.exe" 到 运行 InstallUtil.exe,您只需键入 InstallUtil 即可。如果您没有设置环境变量,您将收到一条错误消息,指出 'installutil' 未被识别为内部或外部命令、可运行的程序或批处理文件。

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?

/kcmd.exe 的参数,它所做的是 运行 后面的字符串指定的命令(在这种情况下它将执行里面的内容 "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\VsDevCmd.bat" 并将执行)。

What is Initial Directory?

初始目录用于指定 working directory 您的 cmd.exe 实例将在

中启动

所以最后你会在 Visual Studio 2015 年得到这样的结果:

VS2015 的 "arguments" 是:

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

我查看了我的开始菜单并右键单击了 VS2015 的开发人员命令提示符。已复制目标 %comspec% /k ""C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\VsDevCmd.bat""

VS2015 的 MSBuild 命令提示符 已复制目标 %comspec% /k ""C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\VsMSBuildCmd.bat""

https://connect.microsoft.com/VisualStudio/feedback/details/747807/vs2012-x64-native-tools-command-prompt