Elevated Command Prompt Here

One of the things that irks me is I’m trying to do stuff in a deeply buried directory in Explorer and then realize that I want to do something Command Prompt related. You get all the way down to where you want to be and say “uwaaaah!” because you realize that you now have to type that long path into a command window. Sure you could copy the path from the directory bar and paste in the command window, but, well, that’s a bunch of steps I don’t want to deal with.

Below you’ll find a set of Registry settings that will enable a “Command Prompt here” and “Elevated Command Prompt here” menu item when you right click on a drive or directory in Explorer.

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\shell\cmd]
@=”CMD Prompt here”
“NoWorkingDirectory”=””
“Extended”=-

[HKEY_CLASSES_ROOT\Directory\shell\cmd\command]
@=”cmd.exe /k \”pushd %L && title Command Prompt\””

[HKEY_CLASSES_ROOT\Directory\shell\runas]
@=”Ele&vated CMD Prompt here”
“NoWorkingDirectory”=””

[HKEY_CLASSES_ROOT\Directory\shell\runas\command]
@=”cmd.exe /k \”pushd %L && title Command Prompt\””

[HKEY_CLASSES_ROOT\Drive\shell\cmd]
@=”CMD Prompt here”
“NoWorkingDirectory”=””
“Extended”=-

[HKEY_CLASSES_ROOT\Drive\shell\cmd\command]
@=”cmd.exe /k \”pushd %L && title Command Prompt\””

[HKEY_CLASSES_ROOT\Drive\shell\runas]
@=”Ele&vated CMD Prompt here”
“NoWorkingDirectory”=””

[HKEY_CLASSES_ROOT\Drive\shell\runas\command]
@=”cmd.exe /k \”pushd %L && title Command Prompt\””

Works on Windows XP, Windows 2003, and Windows Vista. Vista already has Command Prompt here in the menu but it’s normally hidden. It comes down to a single REG_SZ value called Extended, which is removed as part of the Registry file. If you don’t want to lose the hidden option, remove these two lines. I want it to always be there, so I delete that REG_SZ value.

Download: cmdhere.reg