In CMD / .bat, can I change the dir from C to D, but not vice versa?

So here is a copy in my CMD window

C:\Documents and Settings\Developer>cd /d "D:\" D:\>cd /c "C:\" The filename, directory name, or volume label syntax is incorrect. D:\> 

when I run cd / d "D: \" on drive C, it works fine, but when I run cd / c "C: \" on D drive, I get an error

So how do I change the directory back to drive C?

EDIT:

Here is a simpler copy-paste of my CMD window

 C:\>cd /d "D:\" D:\>cd /c "C:\" The filename, directory name, or volume label syntax is incorrect. D:\> 

Doesn't make a scene, why its not working ...

+7
windows cmd batch-file cd
source share
6 answers
 cd /d "C:\" 

- answer

Credit to go to Peter Wright

+7
source share

The parameter is always /d (for "disk"), so you need to do

 D:\>cd /d C:\ 

instead

 D:\>cd /c C:\ 
+12
source share

Ok, I will put it as an answer, then ...

What about cd /d "C:\" , not cd / c "c:\"

+12
source share

You can change dir from c to d with a simple command

 C:\> d: 

Then you get

 D:\> 
+3
source share

you cannot use cd /xx:\ for your network drive, the command is always cd /d

+1
source share

To change drive D: to drive C: simply enter C: ::

 d:\\>c: c:\\> 

To change C: drive to D: drive, D: ::

 c:\\>d: d:\\> 
0
source share

All Articles