Visual Studio 2008 Command From Here

by david 24. September 2009 17:56

I wanted to be able to easily get to a Visual Studio 2008 Command Prompt and run commands from different folders on my machine, essentially like the Command Prompt From Here PowerToy but for Visual Studio. What I ended up doing was taking this information and adapting it, so that you don't need to hold down the shift key. This is what I ended up with:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\Background\shell\VS2008 Command Prompt]
@="Open VS2008 Command Prompt Here"
"NoWorkingDirectory"=""

[HKEY_CLASSES_ROOT\Directory\Background\shell\VS2008 Command Prompt\command]
@="C:\\Windows\\System32\\cmd.exe /s /k \"cd \"%1\" && \"C:\\Program Files\\Microsoft Visual Studio 9.0\\VC\\vcvarsall.bat\"\" x86 "

[HKEY_CLASSES_ROOT\Directory\shell\VS2008 Command Prompt]
@="Open VS2008 Command Prompt Here"
"NoWorkingDirectory"=""

[HKEY_CLASSES_ROOT\Directory\shell\VS2008 Command Prompt\command]
@="C:\\Windows\\System32\\cmd.exe /s /k \"cd \"%1\" && \"C:\\Program Files\\Microsoft Visual Studio 9.0\\VC\\vcvarsall.bat\"\" x86 "

[HKEY_CLASSES_ROOT\Drive\shell\VS2008 Command Prompt]
@="Open VS2008 Command Prompt Here"
"NoWorkingDirectory"=""

[HKEY_CLASSES_ROOT\Drive\shell\VS2008 Command Prompt\command]
@="C:\\Windows\\System32\\cmd.exe /s /k \"cd \"%1\" && \"C:\\Program Files\\Microsoft Visual Studio 9.0\\VC\\vcvarsall.bat\"\" x86 "

Like the original version, it assumes that Visual Studio is installed in the default locations.  But it is proving very useful...

About the author

David

I'm a C# developer having worked with .Net since it was in beta.  Before that I mainly worked in C and C++.  I have been developing commercial software for more than 20 years.  I also mess around with microprocesors, but that's just for fun.  I live near Cambridge, England and at the moment I'm contracted to one of the departments at Cambridge University.

Related Links

Tag cloud