Use the drive letter followed by a colon to switch drives

To change to a different drive in Command Prompt, type the drive letter followed by a colon and press Enter. For example, to switch from your C: drive to your D: drive, type D: and press Enter. The prompt will update to show you are now on that drive.

This works for any drive letter your computer recognizes — internal hard drives, external USB drives, SD cards, or network drives that have been assigned a letter. The command is the same regardless of what is stored on the drive or how it is connected.

If you type a drive letter that does not exist on your system, Command Prompt will show an error message saying the system cannot find the drive specified. This usually means the drive is not connected, not powered on, or has not been assigned a drive letter yet.

Key Takeaways

  • Type the drive letter followed by a colon (like E:) and press Enter to switch to that drive in Command Prompt.
  • The prompt will change to show your new location — for example, from C:\Users\Name> to E:\.
  • External drives, USB sticks, and SD cards work the same way as internal drives once they are connected and assigned a letter.
  • If the drive letter does not work, the drive may not be connected, powered on, or assigned a letter in Windows yet.

Check what drives are available on your system

Before you switch to a drive, you may want to see which drives exist on your computer. Type wmic logicaldisk get name and press Enter. This will list every drive letter that Windows recognizes, including internal drives, external drives, and network drives.

Another way to see your drives is to type diskpart and press Enter, then type list disk. This shows physical drives rather than drive letters, so it is more useful if you are troubleshooting hardware or trying to understand how your storage is organized. Type exit to leave diskpart and return to the regular Command Prompt.

If a drive is connected but does not appear in either list, it may not have been assigned a drive letter yet. You can assign one through Windows Disk Management, or you can use diskpart commands to do it from Command Prompt.

Navigate to a specific folder after changing drives

Once you have switched to a new drive, you can navigate to a specific folder using the cd command (which stands for "change directory"). For example, after typing D: to switch to your D: drive, you could type cd Users\Documents\Photos to move to that folder.

If the folder path contains spaces, you must put the entire path in quotation marks. For example: cd "Program Files\My process". Without the quotes, Command Prompt will stop reading at the first space and show an error.

You can also type cd .. to move up one folder level, or cd \ to jump to the root of the current drive. Type dir to see all folders and files in your current location.

Switch between drives and folders in one command

You can change drives and navigate to a folder at the same time using the /d flag with the cd command. For example, type cd /d E:\Backups\Archive and press Enter. This will switch to the E: drive and move to the Backups\Archive folder in a single step.

Without the /d flag, if you try to navigate to a folder on a different drive, Command Prompt will show an error. The /d flag tells Command Prompt to allow the drive change as part of the navigation command.

This is useful when you are writing scripts or batch files that need to work across multiple drives, or when you want to move through your system quickly without typing two separate commands.

Troubleshoot when a drive letter does not respond

If you type a drive letter and get an error, the drive may be disconnected, turned off, or not yet assigned a letter. For external drives, check that the USB cable is firmly connected or that the drive is powered on if it requires external power.

If the drive is connected but still does not work, open File Explorer and look at the left sidebar under "This PC" to see what drives Windows recognizes. If the drive appears there but not in Command Prompt, it may have a different letter than you expected, or it may not be mounted properly.

You can also type chkdsk D: (replacing D with your drive letter) to check the drive for errors. This command requires administrator privileges, so right-click Command Prompt and choose "Run as administrator" first. If the drive is damaged or disconnected, chkdsk will report that it cannot access the drive.

Understand drive letters and how Windows assigns them

Windows assigns drive letters in a standard order: C: is almost always your main system drive, and other internal drives or partitions get D:, E:, F:, and so on. External drives and USB sticks get the next available letter when you connect them, which means the same external drive might be E: one day and F: the next, depending on what else is plugged in.

If you use the same external drive regularly and want it to always have the same letter, you can assign a permanent letter through Disk Management. Right-click the drive in File Explorer, choose "Rename", or open Disk Management (type diskmgmt.msc in Command Prompt), right-click the drive, and select "Properties" to change its letter.

Network drives can also be assigned letters, which is useful if you frequently access a shared folder on another computer. You can do this through File Explorer by right-clicking "This PC" and choosing "Map network drive", or from Command Prompt using the net use command.

Frequently Asked Questions

What is the difference between typing D: and cd D:\?

Typing D: alone switches to the D: drive but keeps you in the same folder path you were in before (or the root if that path does not exist on D:). Typing cd D:\ explicitly moves to the root folder of the D: drive. In most cases, both commands end up in the same place, but D: is simpler and faster.

Can I change to a drive that is not connected?

No. If you type a drive letter that does not exist, Command Prompt will show an error message. The drive must be physically connected, powered on, and recognized by Windows before you can access it through Command Prompt.

Why does my external drive have a different letter than yesterday?

Windows assigns drive letters based on what is connected at startup and in what order. If you connect a different USB device first, or if an internal drive is not recognized, the letters shift. To keep an external drive at the same letter, assign it a permanent letter through Disk Management.

Do I need administrator privileges to change drives?

No. straightforward typing a drive letter and pressing Enter works in a regular Command Prompt window. You only need administrator privileges if you are running commands that modify the drive, such as formatting, partitioning, or checking for errors.