Microsoft

Redirect the Command Prompt to a folder of your choosing in Windows XP

When you open a Command Prompt, from the Start menu or by typing CMD in the Run dialog box, the Command Prompt window will always open in the C:\Documents and Settings\{yourname} folder. However, having the Command Prompt window open in that folder by default may not always be convenient. Greg Shultz shows you how to reconfigure the Command Prompt shortcut to open in any folder you want.

As you probably know, when you open a Command Prompt, from the Start menu or by typing CMD in the Run dialog box, the Command Prompt window will always open in the C:\Documents and Settings\{yourname} folder. (Where {yourname} is the name of your user account.)

The reason for this is that by default Windows XP is programmed to start the Command Prompt in the folder designated by the %HOMEDRIVE%%HOMEPATH% environment variable, which in most cases translates into C:\Documents and Settings\{yourname}.

However, having the Command Prompt window open in the C:\Documents and Settings\{yourname} by default may not always be convenient. As such, you're left to using the CD (Change Directory) command to manually navigate to the folder of your choice. Fortunately, you can reconfigure the Command Prompt shortcut to open in any folder that you want. Here's how:

Right click on the Command Prompt shortcut on the Start menu and select Properties the command.

When you see the Shortcut tab, double-click the Start in text box to select %HOMEDRIVE%%HOMEPATH% environment variable.

Type the path to the folder in which you want the Command Prompt windows to open.

(If you need more flexibility when opening a Command Prompt window than this tip provides, you might be better served by downloading and installing the Open Command Window Here PowerToy from Microsoft.)

Note: This tip applies to both Windows XP Home and Windows XP Professional.

Miss a Windows XP tip?

Check out the Windows XP archive, and get more hands-on Windows XP tips.

Stay on top of the latest XP tips and tricks with our free Windows XP newsletter, delivered each Thursday. Automatically sign up today!

About

Greg Shultz is a freelance Technical Writer. Previously, he has worked as Documentation Specialist in the software industry, a Technical Support Specialist in educational industry, and a Technical Journalist in the computer publishing industry.

Editor's Picks