
Using Command Prompt from Any Directory
Windows in it’s default setting doesn’t allow you to CMD from a specific folder by “Right-click”, or any other reasonably easy way. Even doing trivial tasks like moving from one folder to another is no easy task. The best way to do this would be go to Starts –> Run –> CMD –> Ok; than browse to your desired folder. Or you could put a cmd.exe in every single folder. None of the options are very convenient.

We could do a little registry hack to make “CMD Here” option appear in every folder by a simple right click, and it will prompt from the desired folder, like this.

For this hack we have to edit the registry. Go to Start –> Run –> Regedit.
The entry that we will edit is located under, HKEY_CLASSES_ROOT\ Directory\shell, we will navigate into that folder and add a new key called “command”, edit the entry and call it whatever you want. I named it “CMD Here”, which is what it will say when you right click a folder.

Now create another key right under the “command” key with the same name. But the value for this entry would be cmd.exe /k “cd %L, basically it is calling cmd from the given folder.

That’s it! Just close the Regedit window and any other explorer window open. Open a new explorer window and you will see this new option to open command prompt from that folder by right click. If you are a heavy command prompt user you will find this option very useful.
iEntry 10th Anniversary
LinuxHaxor
WindowHaxor
MacHaxor














It is also fairly quick to open a command prompt and drag-and-drop a folder into the window to paste its path (e.g. type “cd “, drop in a folder).
Still, I agree “Cmd here” is a useful feature.
Thanks for the information. I’ve been using “Open Command Window Here” which is a Microsoft PowerToy for Windows XP. After installing this executable, it gives me the same capabilities as what you described above. Does this registry hack work for all flavors of Windows?
I tried this ‘hack’ but I get a ‘Permission Denied’ error whenever I try to use the ‘CMD here’ option on the right-click menu of a folder.
There’s an easier way without going near the registry or loading any programs.
- Open My Computer, click Tools -> Folder Options
- Select the File Types tab
- Choose (NONE) Folder and click the Advanced button.
- Click the New button
- Type Command Prompt in the Action field (or whatever you want)
- Type cmd.exe in the Application used field
- Click OK, OK, Close.
Done.
Pretty nice site, wants to see much more on it!
It\’s a great and valuable site!
hey guys i do hav some junk in my comp….my computer doesnot open.it display message as OS choice menu and when i try any option such as safe mode or normaly boot or last good comfiguration than computer again re start and again same message,,,,,,,any one there to help