Type the target drive letter and colon, like D:, to switch drives in Command Prompt. Add /d only when you also want cd to change drives in one step. Using cd D: alone can leave you on the wrong drive and make path checks or batch commands fail. This guide shows the exact syntax, when /d matters, and how to verify the active drive without guessing.

Drive letter basics and how paths interact

How drive switching works in Command Prompt
A laptop screen shows the Command Prompt app in Windows search

Drive letters change the current drive

In cmd.exe, a drive letter prompt such as C:, D:, or E: changes the active drive without needing cd. Only one drive is current at a time. The command prompt updates to the selected drive, and file commands like dir run there until you change again.

Folder paths stay separate from drive changes

cd changes folders, not drives by itself. That is the main source of confusion. A path such as cd \Folder stays on the current drive, while an absolute path such as cd /d D:\Folder can move to another drive and folder together.

What you'll need

  • Command Prompt (cmd.exe), a built-in Windows utility, opened in a terminal window.
  • A quick way to open it, such as pressing Win + R, typing cmd, then pressing Enter.
  • The target drive letter you want to open, such as D: or E:.
  • Optional: administrator launch if the command you plan to run needs elevation.
  • Optional: PowerShell or Windows Terminal, if that is what Windows opens from Win+X.

Switch drives in Command Prompt

  1. Open Command Prompt. Press Win + R, type cmd, and press Enter. That Run command starts cmd.exe and opens Command Prompt.
  2. Type the drive letter. Enter D: or another target drive letter, then press Enter. The active drive changes at once, and you do not need cd for this part.
  3. Confirm the prompt. Look for the new drive letter at the start of the prompt, then run dir. If needed, type echo %cd% to print the current directory path.
  4. Switch back when needed. Type C: to return to C drive, or type another drive letter to move there. Keep using absolute paths if you want a folder on that drive.

📊 Windows 10 can show Command Prompt in the Power User menu. Source: Wikihow.

When does cd /d matter?

When does cd /d matter?
A Windows command prompt shows directory listings and a highlighted dir /ah command

cd /d matters when you want folder and drive changes in one command. Use plain cd for folders on the same drive. Use cd /d when the path points to a different drive, because the switch updates both the active drive and the working folder together.

Change only the folder on the same drive

If you stay on the same drive, cd is enough. For example, cd \Windows\System32 changes the folder on the current drive. The prompt remains on that drive, so there is no drive switch to verify.

Switch drive and folder together

Use cd /d D:\Folder when the destination is on another drive. That is the exact command when you need both changes at once. A common first-timer mistake is typing cd D:\Folder and expecting the prompt to move to D.

Say your prompt is on C:\Users\Name and you need files in D:\Projects\Demo. Typing cd D:\Projects\Demo will not behave the same as cd /d D:\Projects\Demo. The second command changes the drive and the folder in one move.

Drive switch cheat sheet

Action Exact command What changes Common mistake
Move from C to D D: The active drive changes to D. Typing cd D: instead of the drive letter alone.
Jump to a folder on D cd /d D:\Folder The active drive becomes D and the folder becomes \Folder. Dropping /d and staying on the old drive.
Return to C C: The active drive changes back to C. Using cd C: and expecting a drive switch.
Check the active location dir Lists files and folders on the current drive and folder. Running it on the wrong drive because the prompt was not checked.
Print the current path echo %cd% Shows the current directory path in the session. Assuming the prompt text alone proves the folder.
Use a network drive Z: Switches to the mapped network drive if it exists. Expecting a letter to work before the mapping is available.

Why doesn't cmd seem to switch drives?

Why doesn't cmd seem to switch drives?
A Windows Command Prompt window shows a directory listing

Most confusion comes from mixing up the current drive with the current folder. The prompt may look unchanged after cd because cd did not switch drives. In other cases, you may have opened PowerShell or Windows Terminal instead of Command Prompt, or started in a different default folder such as OneDrive.

The prompt stayed on the old path

If you typed cd D:\Folder, Command Prompt may stay on the original drive. Use D: to switch drives first, or use cd /d D:\Folder to move both at once. Then run dir to confirm the contents on that drive.

You opened a different shell

Windows 10 can show Command Prompt in the Power User menu, but PowerShell can replace it in the taskbar menu. Windows Terminal may also open instead of cmd. If the window title or prompt style does not match Command Prompt, start a fresh cmd session from Run with Win + R and cmd.

Your session starts in OneDrive or another default folder

Some sessions open in a folder that is not the root of the drive. That is normal. If you want a different drive, type the drive letter first, then use cd /d with an absolute path. If you need elevated access, open Command Prompt as administrator before you run the command.

Suppose the prompt opens at C:\Users\Name\OneDrive and you type D:. The active drive becomes D, but the prompt still remembers the last folder on D for that session. Running echo %cd% and dir shows the actual location instead of relying on the visible prompt alone.

Common mistakes

  • Typing cd D:. That changes folders only in the current drive context. Use D: to switch drives, or cd /d D:\Folder to do both.
  • Skipping verification. After any drive move, run dir or echo %cd% before you copy, delete, or launch another command.
  • Starting in the wrong shell. If PowerShell or Windows Terminal opens from Win+X, launch cmd directly from Run with Win + R, then type cmd.
  • Forgetting elevation. If a command needs administrator rights, open Command Prompt as administrator first. Do not assume a standard window can reach protected locations.

If that didn't work, try this next

  1. Open cmd directly. Press Win + R, type cmd, and press Enter. This bypasses menu differences in Windows 10 and 11.
  2. Switch with the drive letter. Type D: or E: and press Enter. If the prompt does not change, confirm you are in Command Prompt and not another shell.
  3. Use an absolute path. Type cd /d D:\Folder when you need a different drive and folder. This is the safest form for path-dependent commands.
  4. Verify the active path. Run dir, then echo %cd%. If the output does not match the drive you expected, switch again before continuing.

To avoid repeated confusion, keep the rule simple: use a bare drive letter to change drives, and use cd /d only when you also want a new folder. That habit prevents most path mistakes in batch files and manual command work.

Keep reading

Frequently asked questions

Why won't cmd switch drives

Most often, the command used was cd instead of a bare drive letter, or the window was not Command Prompt. Use D: to change drives, then run dir or echo %cd%. If needed, start a fresh session from Win + R with cmd.

Do I need to type cd before switching drives?

No. A bare drive letter such as D: switches drives by itself. Use cd only when changing folders. When the target folder is on another drive, use cd /d D:\Folder so the drive and directory update in one command.

How do I switch to another drive letter in cmd?

Type the new letter, add a colon, and press Enter. For example, F: moves the session to drive F. If you are moving to a mapped network drive, use the mapped letter the same way, then confirm the location with dir.