CaubleStone Ink

.Net development and other geeky stuff

Tip: Open a .Net Command Prompt Here

Posted on December 21st, 2006


Download (1k)

If you find you want to open a command prompt on a certain folder and have access to all the underlying Visual Studio.Net <your version here> options this is for you.

This is based on similar updates to your windows system in which you can add a new option to your right-click context menu inside of your explorer windows. What this particular tip does is shows you how to add a item to your menu that will open a VS.Net 2003 command prompt on the specified folder, however you follow the same procedure for all versions of visual studio.

Note: This involves updating the registry. You should always backup your registry before making manual changes as your changes could make your system unstable. If you are not comfortable with doing these types of changes you should pass on this tip.

Following the steps below:

1. Open regedit.exe
  Start->Run->regedit.exe
2. Navigate to the following location:
HKEY_CLASSES_ROOT/Directory/shell
3. Add a new key
  VS2003CMD
4. In this key create another key called:
  command
5. Click on the key created in step 3. On the right double-click the Default value and type in the following: (this will be displayed in the context menu).
  Open &VS2003 Command Prompt
6. Click OK
7. Click on the command subkey and then double-click on the default value on the right. Enter the following: (this is the command that will be run).

cmd.exe /k “cd %L && “c:/Program Files/Microsoft Visual Studio .NET 2003/Common7/Tools/vsvars32.bat” && ver”

Make sure you entered the quotes. This also assumes that you have installed VS.Net 2003 in the default folder. If you did not then adjust accordingly.

That should do it. Now if you go into windows explorer you should see a new menu item when you right-click.

To make this easier we have also included a download of the reg file that you can just apply to your system. As with anything to do with the registry you should always double check files you download that update the registry to make sure nothing malicious exists.

Enjoy.