Opening a Command / DOS prompt through Explorer

**NOTE Making changes to the Windows Registry can be dangerous and can render your OS non-functional. BE CAREFUL of what you do. Make a backup before you make any changes.

The following steps will allow you to open a Command / DOS shell at the directory of your choosing through a simple right click within Explorer.

  1. Open regedit and locate the “HKEY_CLASSES_ROOT” key. Within here search for either the HKEY_CLASSES_ROOT\Folder\shell or HKEY_CLASSES_ROOT\Directory\shell key. (Folder effects drives and directories and Directory effects directories only)
  2. Right-click on the key you have chosen and choose “New –> Key”. Give this the name that you wish to see within explorer when you right-click. For example: “Open shell here”
  3. Right-click again this time on the key you just created and give it the name “command”.
  4. In the right-hand pane of regedit, you should see a lone value of “(Default)”. Double-click on this value entry. Enter “cmd.exe /k cd %1” for its value. Note: you can use command.com instead of cmd.exe. Command.com is a 16-bit shell whereas cmd.exe is a 32-bit shell.

Some other ideas you could use here would be to add an additional key and give it a value of “cmd.exe /k /v:ON cd %1” which enables “delayed environment variable expansion”. If you have some ideas, let me know. I’d like to hear how you used this feature.

Leave a Comment