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)
- Start the Registry Editor (regedit.exe)
- Move to HKEY_CLASSES_ROOT\Drive\shell
- From the Edit menu select New - Key and enter a name of CmdHere (or anything else)
- Under the new key select New - Key and enter a name of command (lowercase)
- 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. - 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" - 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