Skip navigation

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

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_ROOT\Drive\shell
  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
    <system dir>\System32\cmd.exe /k cd "%1"
    e.g. c:\winnt\System32\cmd.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,Directory\Shell\CmdHere,,,"Command Here"
HKCR,Directory\Shell\CmdHere\command,,,"%11%\cmd.exe /k cd ""%1


HKCR,Drive\Shell\CmdHere,,,"Command Here"
HKCR,Drive\Shell\CmdHere\command,,,"%11%\cmd.exe /k cd ""%1


Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish