Search code examples
windowsbatch-filecmdcd

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


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...


Solution

  • cd /d "C:\"
    

    is the answer

    Credit go's to Peter Wright