Change the default location of a command prompt?

Posted on 2007-10-08
Last Modified: 2009-07-29
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:\>" ?
Question by:Halonix666
    LVL 4

    Accepted Solution

    Here's a really good article that describes exactly what you want to do:
    ("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.
    LVL 10

    Expert Comment

    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)

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    For a variety of reasons, it sometimes makes sense to reboot a Windows-based computer on a regular, perhaps daily basis. This "cures" a lot of ills by resetting processes, flushing caches, refreshing memory, and reestablish network connections. In a…
    A Bare Metal Image backup allows for the restore of an entire system to a similar or dissimilar hardware. They are highly useful for migrations and disaster recovery. Bare Metal Image backups support Full and Incremental backups. Differential backup…
    With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now