Possible Duplicate:
Using cd Command in Windows Command Line, Can’t Navigate to D:\

Why, just why, is cd in Windows so stupid and does not do what it's supposed to do in the situations like this:

I:\Documents and Settings\blah\>cd C:\somedir\
I:\Documents and Settings\blah\>

I know you can chdir /d. But why is that not the default behavior?

  • @kinokijuf: don't edit the tags if you don't know what they mean. – houbysoft Feb 15 '12 at 18:34
  • I don't agree this is a duplicate. The "duplicate" asks how, not why. – vcsjones Jul 12 '13 at 0:34

This is by design. Each "drive" has it's own working directory. You can use chdir, or you can simply type the drive letter:

> D:

And that will change to the D drive. If you want to know why this behavior exists, see Raymond Chen's Explanation

  • As the blog says, s/has/used to have/, and the cmd shell emulates this behavior. – user1686 Dec 26 '10 at 11:00
  • Basically, because cd is change directory, not change drive. – Rob Feb 15 '12 at 19:09

In windows could use the native cd/d <drive>:<path> or else chdir/d or pushd. It is the /d option that indicates that the drive should change as well. The pushd command does this by default.

Can even alias cd to make that the default behavior like so:

doskey cd=chdir/d $*

Then can use do things like:

cd D:\Temp

and the drive will change as well.

See the help by entering cd/? for more details.


It's a historical thing. cd only changes current directory on the drive that is specified (current if none), and <drive>: changes drives to the folder on that drive which was cd'd earlier (\ if none)


some 3rd party shells - like 4dos has CDD command for this

You can create a batch file called "cdd.bat" in your main Windows directory with the following line:

@cd /d %1 %2 %3 %4 %5 %6 %7 %8 %9

Now, you can do the following with the new CDD command:

C:>cdd d:

D:>cdd c:\documents and settings

C:\Documents and Settings>cdd d:\data


  • How about @cd /d %* – user1686 Dec 26 '10 at 11:01

Not the answer you're looking for? Browse other questions tagged or ask your own question.