CD command on CMD doesn't work

1

This is the screenshot of my command prompt:

enter image description here

Hasani

Posted 2019-04-21T12:25:22.213

Reputation: 129

Well, the command does work, it changes the current directory of drive D: to its root directory; it just doesn't change the current drive... – aschipfl – 2019-04-23T08:27:13.070

Answers

6

You need to use option /d to change the current directory of the drive and change to that drive.
Or you can type the drive letter (c: in this example) to change to the drive.

Microsoft Windows [Version 10.0.17134.706]
(c) 2018 Microsoft Corporation. Alle Rechte vorbehalten.

C:\Users\foo>cd /d d:\

d:\>cd c:\Users\foo

d:\>c:

c:\Users\foo>

Freddy

Posted 2019-04-21T12:25:22.213

Reputation: 1 204

1I forgot about cd /d, which is a better answer than mine, so I have deleted mine, though I did add a note that pushd changes directory and drive, as well as allowing popd to return to the original directory. – AFH – 2019-04-21T12:46:31.073