Visual Studio I need a Command Prompt Quick Tip


Need a command prompt fast while working in Visual Studio? Yes is the answer, especially with modern web development efforts. Often this is to start a command line interface tool, install an npm package, start a web server etc. This is an old tip but is more relevant today than ever. Alt-C is the answer...read how.

- November 10, 2018

Rest of the Story:

Ok, with today's’ development efforts I am in need of a quick way to open a command prompt to the location of the solution. Here is a quick tip on how to enable a keystroke to immediately open one for you (while working within vs.net). Tools > External Tools “Add”

image

Use the following values Title: VS Command Prompt
Command: C:\Windows\System32\cmd.exe
Arguments: /k “C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\VsDevCmd.bat”
Initial Directory: $(SolutionDir) (You can also use $(ProjectDir) to open command prompt in the location of the current project … i like this better) After you hit OK VS Command Prompt command is available under Tools

image

Now you can add a Key Stroke command for this… Tools > Options > Keyboard (here i have added Alt-C). Shown below the only thing to remember is this was my 2nd external tool so I had to look for Tools.ExternalCommand2 to attach my keystroke command.

SNAGHTML58a67cb2

Now Smile I can click Alt-C and immediately a command prompt window opens to the my solution directory.