Where is Developer Command Prompt for VS2013?
Asked Answered
W

9

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?

Wachter answered 31/1, 2014 at 9:33 Comment(1)
T
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.

Toms answered 4/4, 2014 at 19:30 Comment(3)
Good idea -- wrong impl. Set the "Arguments" to /k "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\VsDevCmd.bat"Hepner
the above solution did not fix 'aspnet_regsql.exe' from command prompt. Wired solution did.Leilanileininger
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.Triumvir
W
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.

Whiles answered 28/3, 2014 at 1:14 Comment(9)
I wrote a couple of PowerShell scripts to restore the shortcuts: blog.quppa.net/2014/07/18/…Meeting
Ok. Although, these steps are so simple and quick, I'm not sure it would save any time. :)Whiles
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.Raddy
@Meeting great scripts. Just post them as an answer. Because all the mentioned "solutions" are just tool much work.Pardo
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"" amd64Pentarchy
@DirkBester Or, just pin/copy the command prompt named VS2013 x64 Native Tools Command Prompt as that's what it uses as the target.Whiles
@Whiles Not sure why but for me it had x86 instead of amd64 as is and so needed editing.Pentarchy
sorry for asking but what do you mean by "to the first directory (for the Start Menu)." where is that?Dividers
You can just copy it to the first directory mentioned above. It can't be in a subdirectory.Whiles
T
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.

Toms answered 4/4, 2014 at 19:30 Comment(3)
Good idea -- wrong impl. Set the "Arguments" to /k "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\VsDevCmd.bat"Hepner
the above solution did not fix 'aspnet_regsql.exe' from command prompt. Wired solution did.Leilanileininger
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.Triumvir
S
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

Swat answered 16/4, 2014 at 13:35 Comment(2)
I made sure to uncheck the Prompt for arguments before accepting the dialog.Iberian
For the arguments in step 5, it needs to be '/K' instead of '\k'Mendacity
L
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.

Leilanileininger answered 18/11, 2015 at 10:44 Comment(1)
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.Mariande
D
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.

Duck answered 28/2, 2015 at 9:13 Comment(3)
Good call on Windows 8 not displaying sub-folders, quite annoying.Vilify
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?Pentarchy
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.Duck
H
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

Hetaerism answered 1/11, 2014 at 19:48 Comment(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?Pentarchy
V
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.

Valuable answered 15/3, 2017 at 6:53 Comment(0)
D
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

Dervish answered 22/3, 2017 at 14:20 Comment(0)
S
-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.

Serviceable answered 10/8, 2017 at 14:6 Comment(1)
aspnet_regiis -i where did you take such suggested command? This has nothing to do with the questionJefe

© 2022 - 2024 — McMap. All rights reserved.