How can I open a command prompt at my current drive in Explorer?

John Savill

January 8, 2000

1 Min Read
ITPro Today logo in a gray background | ITPro Today

A. A. Exactly the same as the previous tip but this time a command prompt for a base drive (which has a separate context menu)

  1. Start the Registry Editor (regedit.exe)

  2. Move to HKEY_CLASSES_ROOTDriveshell

  3. From the Edit menu select New - Key and enter a name of CmdHere (or anything else)

  4. Under the new key select New - Key and enter a name of command (lowercase)

  5. Under the key (CmdHere) double click on (Default) and enter a name that will be displayed when you right click on the directory, e.g. "Command Prompt Here"
    As an extra, if you a & to the front of a character it will cause it to be underlined, e.g. "&John Prompt here" would produce John Prompt here.

  6. Move to the command key and again double click on (Default) and enter
    System32cmd.exe /k cd "%1"
    e.g. c:winntSystem32cmd.exe /k cd "%1"

  7. Close the registry editor

Below is an inf file that incorporates the creation of the Command Here for drives and directories of you don't have cmdhere.inf that comes with the resource kit. Save it with a .inf extension and then right click on it and select install.

; Command Here
[Version]
Signature = "$Windows NT$"
Provider=%Provider%

[Strings]
Provider="SavillTech Ltd"

[DefaultInstall]
AddReg = AddReg

[AddReg]
HKCR,DirectoryShellCmdHere,,,"Command Here"
HKCR,DirectoryShellCmdHerecommand,,,"%11%cmd.exe /k cd ""%1


HKCR,DriveShellCmdHere,,,"Command Here"
HKCR,DriveShellCmdHerecommand,,,"%11%cmd.exe /k cd ""%1

About the Author

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like