How to Change Drive in CMD: A Complete Guide
Navigating your file system from the Windows Command Prompt is a foundational skill — and one of the first things that trips people up is switching between drives. Unlike changing directories with cd, moving between drives requires a slightly different approach.
Why Changing Drives in CMD Works Differently
In Windows, each storage drive or partition gets assigned a drive letter — typically C: for your primary drive, followed by D:, E:, and so on for additional drives, USB devices, or optical drives. The Command Prompt treats each lettered drive as its own independent environment, which means the standard cd (change directory) command alone won't move you between them.
This is a common stumbling block: typing cd D: when you're on the C drive won't switch you to D. It will either do nothing or return an error. Understanding this distinction saves a lot of frustration.
The Basic Command: Just Type the Drive Letter
The simplest way to switch drives in CMD is to type the drive letter followed by a colon, then press Enter.
D: That's it. If a D drive exists on your system, your prompt will immediately change to reflect the new location — typically showing something like D:>. No extra flags, no cd, no additional syntax needed.
To switch to another drive:
E: Or back to the default system drive:
C: This works for any assigned drive letter — internal hard drives, SSDs, external USB drives, SD cards mounted as drives, and network-mapped drives all follow the same rule.
Combining Drive Changes with Directory Navigation
Once you've switched to a new drive, you can navigate its folder structure normally using cd.
D: cd ProjectsWebDev If you want to jump to a specific folder on a different drive in one step, use cd with the /d flag:
cd /d D:ProjectsWebDev The /d switch tells CMD to change both the drive and the directory simultaneously. Without it, running cd D:ProjectsWebDev from the C drive will change the stored directory on D, but your active prompt will stay on C.
💻 Quick Reference: Drive Navigation Commands
| Task | Command Example |
|---|---|
| Switch to D drive | D: |
| Switch back to C drive | C: |
| Change drive and folder together | cd /d D:FolderSubfolder |
| Check current drive and path | cd or look at the prompt |
| List drives (check what's available) | wmic logicaldisk get name |
How to See Which Drives Are Available
If you're not sure which drive letters are assigned on your system, you can list them directly from CMD without opening File Explorer.
Run either of these:
wmic logicaldisk get name Or for more detail including drive type and size:
wmic logicaldisk get name, description, size This is especially useful when working with external drives or USB sticks where the assigned letter may vary between sessions or machines.
Common Errors and What They Mean
"The system cannot find the path specified" You've typed a drive letter that isn't currently assigned or connected. Check that your external drive is plugged in, or verify the letter using the wmic command above.
"Access is denied" Some drives or directories require elevated permissions. Right-click Command Prompt and select Run as administrator, then retry your command.
Prompt doesn't change after typing cd D: This is the classic mistake — using cd without the /d flag won't switch the active drive. Use D: alone or cd /d D: to actually move there.
Mapped Network Drives and UNC Paths
If your organization uses mapped network drives (for example, Z: pointing to a shared server folder), the same drive letter syntax applies — just type Z: to navigate there.
For UNC paths (network locations not mapped to a letter, like \ServerNameSharedFolder), CMD doesn't support direct navigation using just \. You'd need to either map that path to a drive letter first using the net use command, or work with the path as an argument to specific commands.
net use X: \ServerNameSharedFolder X: 🗂️ Variables That Affect Your Experience
The straightforward commands above work consistently across modern Windows versions, but a few factors shape how smoothly this goes in practice:
- Drive availability: External drives and USB sticks must be connected and recognized by Windows before their letter appears in CMD
- User permissions: Standard user accounts may hit access restrictions on certain drives or folders that admin accounts won't
- Windows version: The commands covered here work across Windows 7, 8, 10, and 11 — but behavior in older legacy systems or Server editions can differ in edge cases
- Virtual and RAM drives: Software-created drives (like RAM disks or virtual disk mounts) follow the same letter convention but may unmount between sessions
- Drive letter conflicts: When you plug in a new device, Windows assigns it the next available letter — which may differ from what you saw last time, particularly with USB drives
Whether you're a developer organizing projects across multiple drives, a power user managing backups, or someone setting up a script that references specific paths, the exact drives connected and how your system assigns letters to them will determine which commands you actually type.