1

This is the screenshot of my command prompt:

enter image description here

  • 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 Apr 23 at 8:27
5

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>
  • 1
    I 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 Apr 21 at 12:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.