我需要在Visual Studio 2013中的开发人员命令提示符中运行web.exe文件。默认情况下,Visual Studio 2013中没有安装命令提示符。

之前,我使用的是Visual Studio 2012。它默认安装了开发人员命令提示符。

有人知道为什么VS2013默认没有开发者命令提示符吗?如何设置VS2013的开发人员命令提示符?


当前回答

Visual studio command prompt is nothing but the regular command prompt where few environment variables are set by default. This variables are set in the batch script : C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\VsDevCmd.bat . So basically to get a visual studio command prompt for a particular version, just open regular command prompt and run this batch script : C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\VsDevCmd.bat (Change the visual studio version based on your installed version). Voila you have got the visual studio command prompt. You can write a script to run the batch file and open cmd.exe.

其他回答

出于某种原因,在运行Windows 8+时,它不能正确地添加图标。以下是我的解决方法:

使用Windows资源管理器,导航到:

C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Visual Studio 2013

在该文件夹中,你会看到一个名为Visual Studio Tools的快捷方式,它映射到(假设默认安装):

C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\Shortcuts

双击快捷方式(或转到上面的文件夹)。

从这个文件夹中,复制VS2013的Developer Command Prompt快捷方式(以及其他你认为有用的快捷方式)到第一个目录(开始菜单)。系统可能会提示您进行管理访问(请这样做)。

完成这些操作后,现在就有了一个可用于2013命令提示符的图标。

与VS 2017合作 我安装了Visual Studio命令提示符(devCmd)扩展工具。 你可以在这里下载:https://marketplace.visualstudio.com/items?itemName=ShemeerNS.VisualStudioCommandPromptdevCmd#review-details

双击文件,确保在安装过程中关闭IDE。打开visual studio,从VS2017中运行Developer命令提示符

在VS2013菜单中选择“工具”,然后选择“外部工具”。输入如下:

标题:“VS2013原生工具-命令提示符”会很好 命令:C:\Windows\System32\cmd.exe 参数:/k "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\VsDevCmd.bat" 初始目录:根据需要选择。

单击OK。 现在您可以在Tools菜单下访问命令提示符。

我使用了这个答案的修改版本-基于我的经验添加到VS 2010:

Select Tools >> External Tools in Visual Studio Click Add Title: I use Visual Studio Command &Prompt &P Makes P a alt-shortcut key (when menu active) I originally used C, but that conflicts with the existing shortcut for Customize Command: C:\Windows\System32\cmd.exe Arguments: \k "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\vsvars32.bat /k keeps a secondary session active so the window doesn’t close on the .bat file Initial Directory: I use $(ProjectDir) (from the dropdown) Click OK.

现在您可以在Tools菜单下访问命令提示符。

请参见:向Visual c# Express 2010添加命令提示符

Visual studio command prompt is nothing but the regular command prompt where few environment variables are set by default. This variables are set in the batch script : C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\VsDevCmd.bat . So basically to get a visual studio command prompt for a particular version, just open regular command prompt and run this batch script : C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\VsDevCmd.bat (Change the visual studio version based on your installed version). Voila you have got the visual studio command prompt. You can write a script to run the batch file and open cmd.exe.