Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In CMD / .bat I can change dir from C to D but not other way around? [closed]

Ok so here is a copy-paste of 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:\" in C drive it works fine, but when I run cd /c "C:\" in D drive then I get a error

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

EDIT:

Here is 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 scene why its not working...

like image 993
Andre Avatar asked Jul 02 '13 08:07

Andre


People also ask

How do I change directories in a batch file?

Under Windows-10, go to All Apps, Windows System and the open the Command Prompt window. From the command prompt change directory to the batch file directory: cd \Tutorial\batch. Then type the name of the batch file test_conc followed by Enter.


4 Answers

You can change dir from c to d with simple command

C:\> d:

Then you will get

D:\>
like image 130
Vinod Kumar Avatar answered Sep 23 '22 19:09

Vinod Kumar


cd /d "C:\"

is the answer

Credit go's to Peter Wright

like image 28
Andre Avatar answered Sep 19 '22 19:09

Andre


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

D:\>cd /d C:\

instead of

D:\>cd /c C:\
like image 43
Ansgar Wiechers Avatar answered Sep 19 '22 19:09

Ansgar Wiechers


To change D: drive to C: drive, type just c::

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

To change c: drive to d: drive, d::

c:\\>d:    
d:\\>
like image 21
Nyein Avatar answered Sep 21 '22 19:09

Nyein