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


Please or Register to post comments.

Upcoming Training

Mastering System Center 2012

During over 6 hours of training you can join John Savill from your computer as he will walk you through the key components and capabilities of System Center 2012, what’s involved in using the components, and the benefit they can bring to your environment.

Register Now

Current Issue

May 2013 - The NameTranslate object is useful when you need to translate Active Directory object names between different formats, but it's awkward to use from PowerShell. Here's a PowerShell script that eliminates the awkwardness.

CURRENT ISSUE / ARCHIVE / SUBSCRIBE

Windows Forums

Get answers to questions, share tips, and engage with the Windows Community in our Forums.