- Microsoft Windows Server 2003
- Microsoft Windows XP
- Microsoft Windows 2000
You must modify the registry to add the Command Prompt command. You can modify the registry manually, or you can use a script.
To Add a "Command Prompt" Command
Important This section, method, or task contains steps that tell you how to modify the registry. However, serious problems might occur if you modify the registry incorrectly. Therefore, make sure that you follow these steps carefully. For added protection, back up the registry before you modify it. Then, you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click the following article number to view the article in the Microsoft Knowledge Base:322756 How to back up and restore the registry in Windows
Modify the Registry Manually
To add the Command Prompt command to the shortcut menu:- Click Start, click Run, type regedit, and then click OK.
- Locate the following registry key:HKEY_CLASES_ROOT\Directory\shell
- Right-click the shell key, point to New, and then click Key.
- Name the new key OpenNew.
- Click the OpenNew key, and then double-click the Default value in the right pane.
- Change the value to Command Prompt. Click OK.
- Right-click the OpenNew key, point to New, and then click Key.
- Name the new key Command.
- Double-click the Default item in the right pane.
- Change the value to cmd.exe /k cd %1.
Modify the Registry with a Script
To add the Command Prompt command to the shortcut menu:- Copy the following text to a file named Cmdhere.reg:Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\shell\OpenNew]
@="Command Prompt"
[HKEY_CLASSES_ROOT\Directory\shell\OpenNew\Command]
@="cmd.exe /k cd %1" - Save the Cmdhere.reg file.
- Double-click the Cmdhere.reg file to automatically add the registry entries.