Windows 11 and Windows 10 command line switch drives

In command prompt (CMD) on Windows 11 and Windows 10, we can switch from one drive to another drive by just typing the drive letter name suffixed with the character ‘:’.

For example if you are working in C: drive and if you want to switch to E: drive just type ‘E:’ at command prompt and press ‘Enter‘.

Advertisement

Example:

C:\> E:
E:\>

If you want to switch and also move to some particular directory in the new drive then you can use ‘cd’ command with /D switch. For example, to move to E:\dir1 from the above C: drive folder you need to run the below command.

cd /D E:\dir1

This will place you in the E:\dir1 folder. Just doing cd without the /D switch will not change the drive.

Note the backslash after E:. E:\dir1 starts from the root of E:, while E:dir1 is relative to the current directory on E:. Typing just E: switches to that drive’s current directory, which is not necessarily its root.

Advertisement

3 thoughts on “Windows 11 and Windows 10 command line switch drives”

  1. Every time I forget this simple thing…. After trying so many things such as (d:\>, d\\, d:>, d.., d\>,cd d>, etc) i finally get to know its as simple as d:
    Thanks a ton!!

    Reply

Leave a Comment