Nano's Blog

01/19/2010

How to change the default startup directory for Command Prompt?

Filed under: collections — Tags: — nano @ 06:13

When you open a Command Prompt window (CMD.EXE), it defaults to your user profile home directory. If you wish to change the default startup directory for Command Prompt, use the steps listed in this article.

Set the default startup directory

Click Start, Run and type Regedit.exe
Navigate to the following branch:

HKEY_CURRENT_USER \ Software \ Microsoft \ Command Processor

In the right-pane, double-click Autorun and set the startup folder path as its data, preceded by “CD /d “. If Autorun value is missing, you need to create one, of type REG_EXPAND_SZ or REG_SZ in the above location.

Example: To set the startup directory to D:\learning\perl, set the Autorun value data to CD /d D:\learning\perl

You may also use a batch file so that it executes the contents automatically upon launching the Command Prompt. To view the entire list of arguments supported by CMD.EXE and their description, type CMD /? at the Command Prompt.

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress