Visual Studio 2010 Command Prompt Here On the Context Menu of Windows Explorer

You use keyboards and command line more and more, as you get more experienced with the tools in development. If you install git on windows, it creates “Git bash here” context menu on Windows Explorer. It is really handy, and I like it. I believe Visual Studio installation should do the same.

Well, it doesn’t, but you can create it, if you want, with the little manipulation of windows registry.

First, open regedit. Make sure you export the current settings as backup, as your mistake can paralyse your system.

Second, Create two registry keys to enable the context menu on Windows Explorer.

  • HKEY_CLASSES_ROOT\Directory\shell\vs_cmd
  • HKEY_CLASSES_ROOT\Directory\shell\vs_cmd\command

The values are like these

HKEY_CLASSES_ROOT\Directory\shell\vs_cmd

  • Name: (Default)
  • Type: REG_SZ
  • Data: Visual Studio 2010 Command Prompt Here
HKEY_CLASSES_ROOT\Directory\shell\vs_cmd\command
  • Name: (Default)
  • Type: REG_SZ
  • Data: cmd.exe /s /k pushd “%V” && “C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat” x86

Then go to windows explorer and right-click on any directory. You will see a menu “Visual Studio 2010 Command Prompt Here”

Let me explain what’s happening here.

  • “HKEY_CLASSES_ROOT\Directory\shell” is where you put settings for your windows shell.
  • cmd.exe is reachable from any directory, so you don’t have to specify the full path to execute it.
  • /s means to strip quote characters from the command_line (http://ss64.com/nt/cmd.html)
  • /k means to carry out a command but the shell remains without closing.
  • pushd let you execute cmd.exe with a given directory (http://www.hanselman.com/blog/PUSHDReminderItAutomaticallyMapsNetworkDrives.aspx)
  • vcvarsall.bat is a batch file executed when you run visual studio command prompt.

 

I also referenced the below nice posts.

but eventually, I used git’s “bash shell here” registry settings.

 

Visual Studio 2010 Command Prompt Here On the Context Menu of Windows Explorer

3 thoughts on “Visual Studio 2010 Command Prompt Here On the Context Menu of Windows Explorer

  1. Speaking loudly in an effort to be heard over background noise can be just as harmful, and you often don realize you doing it. Laryngitis and hoarseness aren the only consequences of abusing your voice. High-pitched screaming or yelling can cause a bleed of the vocal cords, or you could pull one of the muscles that you use to speak both of which could require medical treatment..

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s