Wednesday, April 2, 2008

Change the command prompt startup directory

By default, when you open a command prompt window (Start>> Run. Type in: cmd [Enter]), it opens to the default user profile directory (see fig #1). Changing this setting requires a registry change. Be sure to make a backup copy before making any changes.

How to change the startup directory:
Go to Start>> Run. Type in: regedit [Enter] or click OK.
Navigate to the following registry key:

HKEY_CURRENT_USER\Software\Microsoft\Command Processor

Single click the entry titled: Command Processor to empty its contents in to the
right pane.

In the right pane, double click the entry titled: Autorun
Double click the Autorun entry.

Place the actual path that you would like the command prompt to start at in to the "Value data:" text box.

Exit the Windows Registry.

Example: To set the Startup Directory at: C:\Windows, enter CD /d C:\Windows in the Value data text box.

Note: If the Autorun entry is not present, create a new string. Here's how:

Right click an empty area of the right pane.

Select New>> String value

Name the new string value: Autorun

Continue with Step #5 above.

No comments: