Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.

Windows 7: Change Directory in Command Prompt

12 Feb 2011   #1

Windows 7 Professional x64
Change Directory in Command Prompt

Anyone know how to do this in command prompt?

I type "cd .." a few times to get to to C:\

Then when I type "cd e:\" I see E:\ below the command line but I'm still in C:\.

Can anyone help?

Edit: Nevermind, manage to get it working. Just had to type "E:" instead of using CD beforehand. So used to linux.

My System SpecsSystem Spec
12 Feb 2011   #2

Windows 7 x64 pro/ Windows 7 x86 Pro/ XP SP3 x86

CD command is only meant to change directories, not drives. If you want to change to drive E: , just type E: at the prompt.
My System SpecsSystem Spec
12 Feb 2011   #3

Microsoft Community Contributor Award Recipient

Windows 8.1 Pro with Media Center

Exactly as Bill told here above. Here a bit more information.

CD (change directory) can be used to change the current, active folder (directory as it was called long time ago ) of either the current drive or another drive. If you use CD command to change active folder in another drive than where you currently are, the change can be seen next time you change the active drive.

Some examples here in the screenshot:


(Click to enlarge)


My System SpecsSystem Spec
12 Feb 2011   #4

Windows 8.1 Pro (x64)

use the /D switch with CD to change the drive along with the path.
> cd /?
Displays the name of or changes the current directory.

CHDIR [/D] [drive:][path]
CHDIR [..]
CD [/D] [drive:][path]
CD [..]

  ..   Specifies that you want to change to the parent directory.

Type CD drive: to display the current directory in the specified drive.
Type CD without parameters to display the current drive and directory.

Use the /D switch to change current drive in addition to changing current
directory for a drive.

If Command Extensions are enabled CHDIR changes as follows:

The current directory string is converted to use the same case as
the on disk names.  So CD C:\TEMP would actually set the current
directory to C:\Temp if that is the case on disk.

CHDIR command does not treat spaces as delimiters, so it is possible to
CD into a subdirectory name that contains a space without surrounding
the name with quotes.  For example:

    cd \winnt\profiles\username\programs\start menu

is the same as:

    cd "\winnt\profiles\username\programs\start menu"

which is what you would have to type if extensions were disabled.
You can read about why this behavior exists here:

Alternatively you could update to PowerShell which is a lot more advance and newer.
My System SpecsSystem Spec

 Change Directory in Command Prompt

Thread Tools

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 13:17.
Twitter Facebook Google+

Windows 7 Forums

Seven Forums Android App Seven Forums IOS App