306

I need to run web.exe file from my developer command prompt in Visual Studio 2013. By default, the command prompt is not installed in Visual Studio 2013.

Previously, I was using Visual Studio 2012. It had developer command prompt installed by default.

Does anyone know why VS2013 doesn't have developer command prompt by default? How can I setup developer command prompt for VS2013?

Voicu
  • 56
  • 5
user276363
  • 3,163
  • 2
  • 12
  • 5

9 Answers9

308

For some reason, it doesn't properly add an icon when running Windows 8+. Here's how I solved it:

Using Windows Explorer, navigate to:

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

In that folder, you'll see a shortcut named Visual Studio Tools that maps to (assuming default installation):

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

Double-click the shortcut (or go to the folder above).

From that folder, copy the shortcut named Developer Command Prompt for VS2013 (and any others you find useful) to the first directory (for the Start Menu). You'll likely be prompted for administrative access (do so).

Once you've done that, you'll now have an icon available for the 2013 command prompt.

WiredPrairie
  • 58,954
  • 17
  • 116
  • 143
  • 1
    I wrote a couple of PowerShell scripts to restore the shortcuts: http://blog.quppa.net/2014/07/18/fix-visual-studio-2013-start-menu-shortcuts/ – Quppa Jul 20 '14 at 07:11
  • 2
    Ok. Although, these steps are so simple and quick, I'm not sure it would save any time. :) – WiredPrairie Jul 20 '14 at 11:28
  • 3
    Helped, Thank You very much. Once you are in the Tools\ShortCuts folder, you can right click and pin to start or pin to task bar. – VivekDev Sep 23 '14 at 07:05
  • @Quppa great scripts. Just post them as an answer. Because all the mentioned "solutions" are just tool much work. – Edward Olamisan Sep 30 '14 at 18:24
  • Finally the one true answer. For 64bit, right click and change Target to be: %comspec% /k ""C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat"" amd64 – Dirk Bester Mar 31 '15 at 20:22
  • @DirkBester Or, just pin/copy the command prompt named `VS2013 x64 Native Tools Command Prompt` as that's what it uses as the target. – WiredPrairie Mar 31 '15 at 20:27
  • @WiredPrairie Not sure why but for me it had x86 instead of amd64 as is and so needed editing. – Dirk Bester Mar 31 '15 at 21:39
  • sorry for asking but what do you mean by "to the first directory (for the Start Menu)." where is that? – cessmestreet Sep 29 '15 at 05:55
  • You can just copy it to the first directory mentioned above. It can't be in a subdirectory. – WiredPrairie Sep 29 '15 at 10:25
247

From VS2013 Menu Select "Tools", then Select "External Tools". Enter as below:

  • Title: "VS2013 Native Tools-Command Prompt" would be good
  • Command: C:\Windows\System32\cmd.exe
  • Arguments: /k "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\VsDevCmd.bat"
  • Initial Directory: Select as suits your needs.

Click OK. Now you have command prompt access under the Tools Menu.

Alexandru Guzinschi
  • 5,675
  • 1
  • 29
  • 40
LuvAspNet
  • 2,860
  • 1
  • 13
  • 10
  • 23
    Good idea -- wrong impl. Set the "Arguments" to /k "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\VsDevCmd.bat" – gap Jun 13 '14 at 13:33
  • the above solution did not fix 'aspnet_regsql.exe' from command prompt. Wired solution did. – TheTechGuy Nov 18 '15 at 08:58
  • 1
    If you can't figure out which "Arguments" value to use, just do a Windows search for "developer command", right click on the Developer Command Prompt icon, then click "Properties" on the context menu, you will see an example of the correct arguments shown in the "Target" input field. – Ross Brasseaux Mar 02 '16 at 21:24
25

I used a modified version of this answer - based on my experiences adding it to VS 2010:

  1. Select Tools >> External Tools in Visual Studio
  2. Click Add
  3. 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
  4. Command: C:\Windows\System32\cmd.exe
  5. 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
  6. Initial Directory: I use $(ProjectDir) (from the dropdown)
  7. Click OK.

Now you have command prompt access under the Tools Menu.

See also: Add command prompt to Visual C# Express 2010

Community
  • 1
  • 1
Michael Paulukonis
  • 9,020
  • 5
  • 48
  • 68
17

enter image description here

You can simply go to Menu > All Programs > Visual Studio 2013. Select the folder link "Visual Studio Tools". This will open the folder. There is bunch of shortcuts for command prompt which you can use. They worked perfectly for me.

I think the trick here might be there are different versions for different processors, hence they put them all together.

TheTechGuy
  • 16,560
  • 16
  • 115
  • 136
  • Simple as that, this way is more efficient that try to run the commands, because, sometimes you have a different VS installation, or a different folder. – Amauri Mar 08 '18 at 12:47
7

I don't know if this changed recently -- the answer given by Samuel did not apply to me even though that link seemed authoritative.

A couple of things

1) For some reason, the folder in the start menu is called Visual Studio 2013, and not Microsoft Visual Studio 2013. Using the win8 apps interface you might see the 2010 entry Microsoft Visual Studio 2010, and since you don't see the new 2013 folder Microsoft Visual Studio 2013 next to it, you assume it isn't there. But it is.. Just a few page scrolls away..

2) It seems the Windows 8 (or 8.1 at least) cannot display sub-folders. I tried creating a folder underneath the Visual Studio 2013 folder with shortcuts, and the entire folder just didn't show.

3) Which is why what is installed is a shortcut. Not sure what the windows 7 behavior is with a shortcut in the start menu, but the apps menu just displays it like a folder. When you click on it, it brings you to the so-called missing shortcuts in explorer.

Final solution: under C:\ProgramData\Microsoft\Windows\Start Menu\Programs, create a new folder called Microsoft Visual Studio 2013. Copy the shortcuts from C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\Shortcuts to that new folder. Then you'll have your icons using the windows 8 app interface under the heading which is the new folder name.

You'll also be able to just start typing from the start screen VS2013, and the icons will now show up.

Gerard ONeill
  • 3,914
  • 39
  • 25
  • Good call on Windows 8 not displaying sub-folders, quite annoying. – Thorarin Mar 11 '15 at 17:41
  • Weird, you got robbed by WiredPrairie who posted a bad version of your answer. Maybe you needed more concise and topic focused language instead of a wall of text. So only the "Final solution", and then a concise list of the issues and what fixed them? – Dirk Bester Mar 31 '15 at 20:39
  • Dirk, WiredPrairie's answer might not explain anything, but it was the first answer to say what needed to be done, and it did come almost a year before mine. I did 'miss' his answer though since nothing was explained, not realizing it was the same as mine ;). I'm happy 2 people found my insight useful. – Gerard ONeill Apr 01 '15 at 12:20
1

Since any solution given so far will open the command prompt on the project folder, you would still have to navigate to the project's folder. If you are interested in getting the command prompt directly into the project's folder, here is my 2 steps:

  1. Right-click in solution explorer on the project name (just under the solution name) and choose the command "Open Folder in File Explorer"
  2. Once the Windows Explorer is open, just type in the address bar "cmd" and then hit enter!

Et voila! Hope that helps

wonea
  • 4,783
  • 17
  • 86
  • 139
MarcWithAC
  • 37
  • 1
  • No. This opens a cmd prompt and everyone already knows how to do that many different ways. The OP asked for a DEVELOPER command prompt. Finally, why would you do something that complicated when you can simply pin the developer prompt(s) to the task bar and modify the start in(s) to be exactly what you want? – Dirk Bester Mar 31 '15 at 20:28
1

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.

prashanthns
  • 339
  • 2
  • 12
1

Works with VS 2017
I did installed Visual Studio Command Prompt (devCmd) extension tool.
You can download it here: https://marketplace.visualstudio.com/items?itemName=ShemeerNS.VisualStudioCommandPromptdevCmd#review-details

Double click on the file, make sure IDE is closed during installation.
Open visual studio and Run Developer Command Prompt from VS2017

enter image description here

Serge V.
  • 3,377
  • 3
  • 20
  • 28
-1

I'm using VS 2012, so I navigated to "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Microsoft Visual Studio 2012\Visual Studio Tools" and ran as administrator this "Developer Command Prompt for VS2012" shortcut. In command shell I pasted the suggested

aspnet_regiis -i

and as I suspected this did not yield any success on Windows 10: enter image description here

So all I needed to do was "Turn Windows Features On/Off" at Control Panel and restart my machine to effect the changes. That did resolve the issue. Thanks.

Chagbert
  • 722
  • 7
  • 16
  • `aspnet_regiis -i` where did you take such _suggested_ command? This has nothing to do with the question – gog Jul 09 '20 at 09:10