Microsoft KB Archive/816097

= HOW TO: Start a Command Prompt in a Folder in Windows Server 2003 =

PSS ID Number: 816097

Article Last Modified on 3/1/2004

-

The information in this article applies to:


 * Microsoft Windows Server 2003, Web Edition
 * Microsoft Windows Server 2003, Standard Edition
 * Microsoft Windows Server 2003, Enterprise Edition
 * Microsoft Windows Server 2003, Datacenter Edition
 * Microsoft Windows Server 2003, 64-Bit Enterprise Edition
 * Microsoft Windows Server 2003, 64-Bit Datacenter Edition
 * Microsoft Windows Small Business Server 2003, Standard Edition
 * Microsoft Windows Small Business Server 2003, Premium Edition

-



IMPORTANT: This article contains information about modifying the registry. Before you modify the registry, make sure to back it up and make sure that you understand how to restore the registry if a problem occurs. For information about how to back up, restore, and edit the registry, click the following article number to view the article in the Microsoft Knowledge Base:

256986 Description of the Microsoft Windows Registry

IN THIS TASK

 * SUMMARY
 * How to Add a &quot;Command Prompt&quot; Command
 * Modify the Registry Manually
 * Modify the Registry with a Script



SUMMARY
WARNING: If you use Registry Editor incorrectly, you may cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that you can solve problems that result from using Registry Editor incorrectly. Use Registry Editor at your own risk.

This step-by-step article describes how to open a command prompt in a folder in Windows Server 2003. If you use a command prompt frequently, you may want to start a command prompt in a specific folder instead of using the cd command to move to the folder that you want to change to. Instead, you can put a Command Prompt command on the shortcut menu in My Computer or Windows Explorer to start a command prompt in the folder that you want. When you do this, you can right-click any folder in Windows Explorer, and then click Command Prompt on the shortcut menu to open a command prompt in that folder. To do this, you must modify the registry to add the Command Prompt command. You can modify the registry manually, or you can use a script.

back to the top

How to Add a &quot;Command Prompt&quot; Command
back to the top

Modify the Registry Manually
To add the Command Prompt command to the shortcut menu:  Click Start, click Run, type regedit, and then click OK. Click the following registry key:

 

 Right-click the shell key, point to New, and then click Key. Name the new key Cmd. Click the Cmd key, and then double-click the Default value in the right pane. Change the value to Command Prompt, and then click OK. Right-click the Cmd key, point to New, and then click Key.</li> Name the new key Command.</li> Click the Command key, and then double-click the Default item in the right pane.</li> Change the value to cmd.exe/k cd %L .</li> Click OK, and then quit the Registry Editor.</li></ol>

If you have multiple drives on your computer, you can add a similar command to the shortcut menu that appears when you right-click a drive in Windows Explorer or My Computer. The steps to do this are the same as those for creating the Command Prompt command, except that you use the   registry key as the starting point. Also, change the value of the Default value in the   key to cmd.exe/k.

back to the top

Modify the Registry with a Script
To add the Command Prompt command to the shortcut menu: <ol> Copy the following text to a file that is named Cmd.reg:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\shell\cmd]

@=&quot;Command Prompt&quot;

[HKEY_CLASSES_ROOT\Directory\shell\cmd\Command]

@=&quot;cmd.exe /k cd %L&quot;

</li> Save the Cmd.reg file.</li> Double-click the Cmd.reg file to automatically add the registry entries.</li></ol>

back to the top

Keywords: kbMgmtServices kbHOWTOmaster KB816097

Technology: kbSBServ2003Pre kbSBServ2003Search kbSBServ2003St kbSBServSearch kbWinServ2003Data kbWinServ2003Data64bit kbWinServ2003Data64bitSearch kbWinServ2003DataSearch kbWinServ2003Ent kbWinServ2003Ent64bit kbWinServ2003Ent64bitSearch kbWinServ2003EntSearch kbWinServ2003Search kbWinServ2003St kbWinServ2003Web

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© 2004 Microsoft Corporation. All rights reserved.