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:\
CMD cd to other drives except C:\ not working

I am working with cmd.exe on Windows 7 (as opposed to Powershell). I have 2 partitions on my drive, C contains the OS and installed programs, and D contains my data. I was trying to cd from C to D, but cmd wouldn't let me:

C:\>cd D:\


However, when I type dir D:\, it will list the contents of D correctly. Why does it do this and how can I fix it? Powershell works fine so I can use that, but I would like to know what makes cmd misbehave.

share|improve this question

marked as duplicate by Synetech, Canadian Luke, allquixotic, 8088, bwDraco Dec 1 '12 at 1:39

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.

Could someone make an msdos tag? I think this question is valid for all versions of DOS from 1.0 and up. If I recall correctly CP/M didn't have this concept but you could address the separate drives by prepending the driveletter: to the file name. I think this is important as this is a valid question for someone who didn't live through the DOS era and not a Windows 7 question as such. – Stuart Woodward Dec 1 '11 at 0:31
@StuartWoodward actually DOS 1.0 did not have subdirectories - they were introduced in 2.0. – Jesse Slicer Dec 2 '11 at 18:31
up vote 30 down vote accepted

You have to use just d: , not cd d:\

EDIT: it is also possible to use cd /d d: to change drives using cd

share|improve this answer
Thanks, I never knew that! – astay13 Nov 27 '11 at 1:40
I am not really sure why made that design decision, and I am looking for it, but that's just the way that it has always been. – soandos Nov 27 '11 at 1:41
@astay13 see edit. – soandos Nov 27 '11 at 1:42
@soandos cd stands for "change directory", and D: is a drive, not a directory. See David's answer for more details – Izkata Nov 27 '11 at 5:56
@Izkata why cant you change to a directory on a different drive using the same syntax used to go to a different folder? that is what I was saying. – soandos Nov 27 '11 at 5:58

Windows tracks a separate working directory for each drive. You are currently on the 'C' drive in the working directory '\'. When you type cd d:\ it changes your working directory for the 'D' drive to '\' and has no effect on your C drive working directory. To change drives, just type D:. You can change both at the same time with the /d parameter to cd.

share|improve this answer
Actually, the Windows that the questioner says that xe is running — Windows NT 6.1 — has never — not since 1993 — had a separate working directory for each drive. There is one working directory per process. The appearance of multiple working directories across multiple drives is a fiction maintained by Microsoft's command interpreter and the runtime libraries of its languages, using hidden environment variables. – JdeBP Nov 27 '11 at 20:33
@JdeBP Hidden environment variables that track a separate working directory for each drive? And is Microsoft's command interpreter and the runtime libraries of its languages part of Windows? – David Schwartz Feb 2 at 20:07

It should be noted that pushd (e.g. pushd D:\) will always change drives.

share|improve this answer
This would be wonderful as a comment to the question but doesn't answer the question. – Stuart Woodward Dec 3 '11 at 4:48

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