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:\

Every time I want to change directory context to another drive (D, E, F, or whatever..) on a Windows command-prompt, I must use "Drive letter":\ command to actually change it. If I try with "cd command" on cd H:\ it just echo H:\ for me and do nothing:

Enter image description here

Is there some reason for such a behavior? I mean, shoudn't cd command work to do this? Why does't it?

share|improve this question

marked as duplicate by Oliver Salzburg, Daniel Beck, slhck, Peter Mortensen, haimg Apr 16 '12 at 19:29

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.

Related. – Daniel Beck Apr 16 '12 at 18:04
up vote 15 down vote accepted


cd /d d:

/d will also switch drive letters as well as directories, for other information, see cd /?

share|improve this answer
Looks like cmd.exe mimics the behavior of DOS pretty well in this situation, whereby the "current directory" for each drive is remembered distinctly. – LawrenceC Apr 16 '12 at 17:36
This is the real answer to "why Widows works this way": because DOS did it that way. – KutuluMike Apr 16 '12 at 18:00

The reason Windows behaves this way, is because DOS behaved that way.

In DOS, each drive has its own current directory, and the cd command changes the current directory on a drive. If that also happens to be the current drive, then your working directory changes along with it. If you want to change the current drive, you simply specify the drive letter as a command.

Notes that Windows doesn't actually work this way anymore -- you only have one current directory at any time -- but the command shell goes to great lengths to pretend that there are still per-drive current directories. Presumably this is to preserve compatibility with existing DOS batch files.

The reason DOS works this way dates back to the very earliest versions of DOS, and CP/M before it. The gory details can be found on Raymond Chen's blog.

share|improve this answer

The straight-forward answer is that "because it is not written to work that way". Simply entering D: will do what you want.

Curiously entering cd D:\somedir will, in fact, change the current directory on D: to \data, but will not change the current command prompt to D:.

share|improve this answer

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