• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1663
  • Last Modified:

Change the default location of a command prompt?

Ok this may seem a little mundane and rediculus but its just something that has bugged me slightly for a while so I figured I would ask you all about it as the solution does not appear to be as obvious as it might seem.

When you open a command prompt it automatically defaults to "C:\Documents and Settings\username"... my question for you all is; Is there a way to change that to just default to the system drive, in this case, "C:\>" ?
0
Halonix666
Asked:
Halonix666
1 Solution
 
jimstarCommented:
Here's a really good article that describes exactly what you want to do:

http://windowsxp.mvps.org/autoruncmd.htm
("How to change the default startup directory for Command Prompt?")
=================

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 F:\Windows, set the Autorun value data to CD /d F:\Windows

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.
0
 
JstncaseCommented:
You should also be able to setup a shortcut to run CMD and simply change the Working directory as well.

Create a shortcut
- commandline is CMD.EXE
- change the Start In directory to wherever you want it, variables do work, as by default it uses %WINDIR%

(Note: I am running this from Windows XP btw)
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now