How-To Geek
Add the Command Prompt to the Windows Explorer Right-Click Menu
A hidden functionality in Windows allows you to right click on a directory, and select “Command Prompt Here” from the menu.
Here’s the registry hack to get this working. Make sure you back up your registry just in case. I’ll show you the step-by-step method, but you can skip down to the bottom for the alternate reg file.
Step-By-Step Method:
Type regedit.exe into the Start\Run dialog, and then navigate to the following registry key:
HKEY_CLASSES_ROOT\Directory\shell
Once you are at that key, right click and choose the New Key option:
Name the key “CommandPrompt” without the quotes and then double-click on the default value. Change the text to “Command Prompt Here” as seen here:

Right click on the new Command key and select New key, as you did before. Name the new key Command as well, and then double-click the default value of that key. Set the text of that key to this:
cmd.exe /k cd %1
You can see what it should look like here:


Now when you right click on the folder, you should see this dialog:

That will open up a prompt like this:

Alternate method:
You can create a text file named anything.reg, and insert this text into it:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\shell\CommandPrompt]
@=”Command Prompt:”
[HKEY_CLASSES_ROOT\Directory\shell\CommandPrompt\Command]
@=”cmd.exe /k cd %1″
Double click on that file, and the text will be entered into the registry, and you’ll have the same right click command prompt.
Another Alternate Method:
You can download the powertoy from Microsoft that provides the same functionality:
http://www.microsoft.com/windowsxp/pro/downloads/powertoys.asp
Got Feedback? Join the discussion at discuss.howtogeek.com
Comments (15)
Programmer by day, geek by night, The Geek, also known as Lowell Heddings, spends all his free time bringing you fresh geekery on a daily basis. You can follow him on Google+ if you'd like.
- Published 11/25/06




Nice and easy to implement..
Very nice, very useful!
Thanks a lot. It’s a great idea.
Do I follow the same procedure to undo this? Please help….
hey Man
to good really i am damn impressed god work man.and its availabe for us.
thanks a ton :)
hope you will continue like this
take care
Manish
Great idea!!! Thanks for sharing the trick man
take care
Hi, I had this a while ago, but completly lost how to do it. Here is a fix to make it work with folders with an & in its name:
cmd.exe /k cd %1
Just a comment on the reg code posted under “Alternate Method:”.
The last quotation is unicode…If you copy-paste into a .reg file, it’ll warn you about saving unicode.
Looking at the file, that last quotation is replaced with a question mark.
If you just change it back to a regular quotation, it works fine.
Not sure if this affects anyone else…Just thought I’d mention it.
does this need system to be restart? it is not on my computer
it is not working on my computer
” code is wrong.
:p
:p
:p
Hey,i just viewed the article. I havent tried the code yet, by any chance, is this case sensitive?
For windows 7 it is:
cmd.exe /s /k pushd “%V” – this will open a command prompt window from
The changes in registry are instantaneous, no restart required.
It really works! :))
PS: @Thomas is right!
How To Add the Command Prompt to the Desktop Right-Click Menu. Please help me. Thanx..
Hi, is there any way to create a context menu entry to run commandline programs without manually opening cmd.exe first?