How To Change Drive in CMD

how to change drive in cmd

In the Windows command prompt (CMD), we use the cd command to change from one directory to another. However, it only changes the path inside the current drive by default.

If you want to change to a different drive in CMD, you need to use the /d switch.

cd /d D:

For example, I am working on the command prompt, inside the C:\Users\user1 folder. Now I want to move into a folder called data which is in the D: drive.

command prompt change drive

In the above screenshot, you can see that the command didn't work. The solution is to use the /d switch.

how to change drive in command prompt

Alternatively, simply enter the drive letter followed by a colon, as follows:

D:

However, this method only changes to the root of the drive. If you want to go to a folder, you have to use the CD command.