Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

marked as duplicate by Synetech, allquixotic, 8088, bwDraco, Nifle Dec 1 '12 at 10:41

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

@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
up vote 19 down vote accepted

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

share|improve this answer
As the blog says, s/has/used to have/, and the cmd shell emulates this behavior. – grawity 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.

share|improve this answer

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)

share|improve this answer

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


share|improve this answer
How about @cd /d %* – grawity Dec 26 '10 at 11:01

Not the answer you're looking for? Browse other questions tagged .