Open a command prompt in any folder using Windows Explorer

by Wayne Maples [Published on 20 April 2004 / Last Updated on 20 April 2004]

I find the command prompt very productive. I want to be able to use Windows Explorer to navigate anywhere on the box and then by right clicking a folder, have a command shell open up in that folder. The following registry hack gives you that capabiltiy in Windows 2000 / Windows XP / Windows Server 2003 :

Windows Registry Editor Version 5.00
BLANK LINE GOES HERE

[HKEY_CLASSES_ROOT\Directory\shell\OpenNew]
@="Command Prompt"
[HKEY_CLASSES_ROOT\Directory\shell\OpenNew\Command]
@="cmd.exe /k cd %1"
BLANK LINE GOES HERE

Take the above file and save it as command.reg or shell.reg or whatever. To make the registry edit, run it by double clicking the file in Explorer or running it as a programs from the command shell. Don't be concerned about the REGEDIT4 line which is NT4. This .reg file will make the correct registry edit for NT, W2K and XP. When you run it, you will be asked Are you sure you want to add the information in command.reg to the registry?. Answer yes. You should then see the message Information in command.reg has been successfully entered into the registry. At this point you should be able to browse your drives and right-click on any folder. One of the options should now be Command Prompt which will open a command shell in that folder when selected. Enjoy!

For more information on .reg files, see Understanding .REG files

By the way, you if want to start up Windows Explorer in the current directory, simply type on the commandline:

start.

Featured Links