Wednesday 17 August 2016

How to create "Open Developer Command Prompt for VS2015 Here" context menu on Windows 10

As a developer, sometimes I want to open up an elevated command prompt with all developer command line utilities enabled at once.

Actually there are a few registry tweaks to open up an "elevated command prompt" here, but none of them that I found supported Visual Studio command prompt. So I made another tweak on top of the tweak to enable this. Enjoy! 

** Try this at your own risk ** 

  1. Save the following contents on a reg file. eg. VSDEVCMD.REG
  2. Run the reg file.
  3. Click "Yes" on the warning dialogue. 

Windows Registry Editor Version 5.00   

[-HKEY_CLASSES_ROOT\Directory\shell\runas]   

[HKEY_CLASSES_ROOT\Directory\shell\runas] 
@="Open command window here as Administrator" 
"HasLUAShield"=""   

[HKEY_CLASSES_ROOT\Directory\shell\runas\command] 
@="cmd.exe /s /k \"pushd \"%V\" && call \"C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\Tools\\VsDevCmd.bat \"\""

[-HKEY_CLASSES_ROOT\Directory\Background\shell\runas]   

[HKEY_CLASSES_ROOT\Directory\Background\shell\runas] 
@="Open command window here as Administrator" 
"HasLUAShield"=""   

[HKEY_CLASSES_ROOT\Directory\Background\shell\runas\command] 
@="cmd.exe /s /k \"pushd \"%V\" && call \"C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\Tools\\VsDevCmd.bat \"\""

[-HKEY_CLASSES_ROOT\Drive\shell\runas]   

[HKEY_CLASSES_ROOT\Drive\shell\runas] 
@="Open command window here as Administrator" 
"HasLUAShield"=""   

[HKEY_CLASSES_ROOT\Drive\shell\runas\command] 

@="cmd.exe /s /k \"pushd \"%V\" && call \"C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\Tools\\VsDevCmd.bat \"\""

Evernote helps you remember everything and get organized effortlessly. Download Evernote.