Open Command Prompt Here
One can extend the context menu when right-clicking a folder in Windows Explorer, with the option to open a command prompt in that directory. Instead of just opening the command prompt and manually changing to the wanted directory.
- Windows Vista - Will display the option “Open Command Window Here” when right-clicking a folder, while holding down the SHIFT key (Part of the extended context menu options).
- Windows XP - Download the WinXP Powertoy - Open Command Window Here.
- Other versions of Windows - Try using WinXP Powertoy BETA2 - Open Command Window Here, which isn’t locked to only work on Windows XP.
Manual add option using Windows Explorer
To manually add the option through Windows Explorer interface:
- Start “My Computer”
- In the “My Computer” menu select “Tools” -> “Folder Options…”
- Select the fan “File Types”
- Sort the registered file types by name by clicking the 2nd column
- Find and select the file type “Folder”
- Press the “Advanced” button, and a new window pops up
- Press the “New…” button, and a new window pops up
- Set the action to be:
Open Command Prompt Here
- Set the application to be:
cmd.exe /k “cd %L”
Note that the “%L” is used to show the long name of the directory. If you use “%1” then it will use the 8.3 format.
- Press Ok to save the newly added entry
Related Configure file types to include your own useful actions
Manual add option using Registry Editor
Note one can also extend the context menu by applying the following registry settings. More Info MS KB320148:
REGEDIT4
[HKEY_CLASSES_ROOT\Directory\shell\cmd]
@=”Open Command Window Here”[HKEY_CLASSES_ROOT\Directory\shell\cmd\command]
@=”cmd.exe /k \“cd %L\””[HKEY_CLASSES_ROOT\Drive\shell\cmd]
@=”Open Command Window Here”[HKEY_CLASSES_ROOT\Drive\shell\cmd\command]
@=”cmd.exe /k \“cd %L\””
Note if not running as administrator by default, and want to open a command prompt session with administrator rights, then it can be done by adding a RunAs option for the directory filetype (Useful if using Windows Vista):
REGEDIT4
[HKEY_CLASSES_ROOT\Directory\shell\runas]
@=”Open Command Window Here (Administrator)”[HKEY_CLASSES_ROOT\Directory\shell\runas\command]
@=”cmd.exe /k \“cd %L\””[HKEY_CLASSES_ROOT\Drive\shell\runas]
@=”Open Command Window Here (Administrator)”[HKEY_CLASSES_ROOT\Drive\shell\runas\command]
@=”cmd.exe /k \“cd %L\””