Command Prompt Entry in a Folder's Shortcut Menu

Overview

It’s handy to have an entry in the Windows Explorer context menu which will enable you to open a Command Window and automatically navigate to that folder. Here's how to create a Command Prompt entry on the context menus for both folders and drives. Similarly, this procedure will also add a VS Command Prompt entry (not shown in the screen shot below).

Image

Image

Procedure


{copytext|vscmd}
%comspec% /k ""C:\Program Files\Microsoft Visual Studio 8\VC\vcvarsall.bat"" x86
cmd.exe /k cd /d "%1"


{copytext|registry}
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\shell\cmd]
@="Command &Prompt"

[HKEY_CLASSES_ROOT\Directory\shell\cmd\command]
@="cmd.exe /k \"cd /d %L\""

[HKEY_CLASSES_ROOT\Drive\shell\cmd]
@="Command &Prompt"

[HKEY_CLASSES_ROOT\Drive\shell\cmd\command]
@="cmd.exe /k \"cd /d %L\""

[HKEY_CLASSES_ROOT\Directory\shell\vscmd]
@="&VS Command Prompt"

[HKEY_CLASSES_ROOT\Directory\shell\vscmd\command]
@="C:\\Data\\vscmd.bat \"%1\""


Windows 7