In CMD, cd changes folders on the current drive; use cd /d to switch drives, and quote paths with spaces. If you skip the drive switch or type the wrong target, CMD stays in the old location and build scripts, tools, and file paths fail. I hit this a lot while testing builds and jumping between project folders, so this guide shows why cd fails in real Windows sessions and gives a checklist for same-drive, cross-drive, and Developer Command Prompt path selection.

What you'll need before you start

  • Command Prompt opened from Start search by typing cmd or with Run as administrator if permissions block the folder.
  • The target folder path, preferably copied exactly, including any spaces.
  • A quick way to confirm your current location with dir.
  • Optional: Tab completion and drag-and-drop path paste for long folder names.
  1. Open Command Prompt from Start search.
  2. Run dir to see the current folder contents before you move.
  3. Confirm whether your target is on the same drive, another drive, or a network path.
  4. Use the shortest command that matches the path type.

How to change directory in CMD

cd means change directory, and chdir does the exact same thing in Command Prompt. A directory is just another name for a folder. The command accepts folder paths and relative paths, so cd Documents works when Documents sits under the current folder. For a quick directory check, dir lists directory contents.

Use relative paths when the folder is nearby. Use a full folder path when you want to jump directly to a known location such as C:\Windows\System32. If the folder name contains spaces, wrap the path in quotes, or paste the full path after cd and a space.

  1. Type dir and press Enter.
  2. Type cd plus the folder name you want, such as cd Documents.
  3. Use Tab after typing cd to cycle through folder names.
  4. Paste or type a full path if the folder is not nearby.

How do you move to another drive?

Changing only the drive letter switches the active drive, so C: to D: or E: is often the first fix. When you want both a new drive and a folder on that drive, use cd /D. That matters because cd alone changes folders on the current drive and may leave you on the old drive prompt.

  1. Type the drive letter by itself, such as D:, if you only need to switch drives.
  2. Type cd /D E:\OBS when you want to jump to a folder on another drive.
  3. Use cd /D J: when you only need to switch to the J: drive.
  4. For network paths, first map the share to a drive letter if direct changing fails.

Command Prompt change directory from C to D

If the prompt is on C: and the folder is on D:, D: by itself changes the active drive. If you also need a folder, use cd /D D:\FolderName. This avoids the common mistake where cd D:\FolderName leaves the prompt on the old drive and does not land where expected.

How do you go to Desktop, Downloads, or a parent folder?

How do you go to Desktop, Downloads, or a parent folder?

Desktop and Downloads usually live under a user profile, so full paths are safer than guessing. The dot-dot notation moves up one directory, and cd .. is the standard move up a level. Multiple .. segments move back several directories when you overshoot or need to back out quickly.

  1. Use the full Desktop path, such as cd /D C:\Users\Alex\Desktop.
  2. Use the full Downloads path, such as cd /D C:\Users\Alex\Downloads.
  3. Type cd .. to move up one directory.
  4. Type cd ..\.. to move up two levels.

How to command prompt change directory to desktop

Use the full Desktop path instead of trying to guess from the current folder. If the account name is Alex, cd /D C:\Users\Alex\Desktop lands directly on the Desktop from any drive. If you are already in C:\Users\Alex, then cd Desktop is enough.

How to command prompt change directory to downloads

Downloads works the same way. If the account name is Alex, cd /D C:\Users\Alex\Downloads gets you there from anywhere. If you are already under the user profile, cd Downloads is the shorter relative-path version and avoids typing the full path again.

Why won’t Command Prompt change directory?

Why won’t Command Prompt change directory?

Most failures come from one of four things: the folder is on a different drive, the path contains spaces or bad quotes, the current account lacks permission, or the window is a Visual Studio Developer Command Prompt with its own starting context. The symptom matters. A prompt that ignores your folder usually means the drive switch was missed or the path was copied wrong.

  1. If the folder sits on another drive, add /D or switch to the drive letter first.
  2. If the folder name has spaces, wrap the path in quotes or paste the full path after cd and a space.
  3. If access is denied, reopen Command Prompt with Run as administrator.
  4. If you are in a Developer Command Prompt, use its environment-aware prompt path, not a plain CMD assumption.

developer command prompt for vs 2022 change directory

A Visual Studio Developer Command Prompt starts with build tools on the path, so folder navigation still uses cd, but the starting context is not the same as plain CMD. Use the exact folder path you want, such as a project directory under your source tree, and confirm with dir before launching builds.

Command Prompt path decision table

Use this table when you need the exact command without guessing. The path type tells you whether to use a plain cd, a drive switch, or a full quoted path.

Current prompt state Target path type Exact command to use
C:\Users\Alex> Same drive, folder under current location cd Documents
C:\Users\Alex> Another drive D: or cd /D E:\OBS
C:\Users\Alex> Network path cd /D \\Server\Share\Folder if supported, or map a drive first
C:\Users\Alex> Desktop cd /D C:\Users\Alex\Desktop
C:\Users\Alex> Downloads cd /D C:\Users\Alex\Downloads
VS 2022 Developer Command Prompt Project folder on any drive cd /D C:\Dev\Project

Common mistakes

Most bad cd results are self-inflicted. The command is simple, but Windows path rules are strict. A copied path with one missing quote, one missing backslash, or one forgotten drive switch is enough to keep the prompt in the wrong place.

  1. Typing cd without checking the current drive context.
  2. Forgetting /D when moving to a folder on another drive.
  3. Copying a path with the wrong quotes around spaces.
  4. Missing the space after cd before pasting a path.
  5. Using a folder path that belongs to another user account.

For fast path entry, type cd and a space, then drag a folder into the Command Prompt window and press Enter. That pastes the folder path for you and cuts down on typo errors. If the folder name is long, Tab completion is faster than typing every character.

If that didn’t work, try this next

If the prompt still will not move, escalate in this order: verify the current directory with dir, switch to the drive letter alone, retry with cd /D, then reopen the window with Run as administrator. This order catches the most common path and permission problems before you start chasing rarer issues.

  1. Run dir to confirm where you are.
  2. Type the destination drive letter alone, such as E:.
  3. Retry with the full command, such as cd /D E:\OBS.
  4. Open a new window with Run as administrator if access is blocked.

Prevention: when working in deep folder trees, keep a habit of checking the prompt before each jump and use cd /D for any move that crosses drives. That avoids the silent failure where CMD stays on the old drive and your next tool runs in the wrong place.

Frequently asked questions

how to command prompt change directory

Type cd followed by a folder name or full path, then press Enter. If the folder is on the same drive, cd Documents is enough. If it is on another drive, use cd /D E:\OBS or switch to the drive letter first.

why won’t command prompt change directory

It usually fails because the folder is on another drive, the path has spaces and bad quotes, or the prompt lacks permission. Check the current location with dir, then try cd /D with the full path and reopen CMD with Run as administrator if needed.

command prompt change directory to different drive

Use the drive letter by itself, such as D:, when you only need to switch drives. If you want the drive and a folder together, use cd /D D:\FolderName. That is the safest choice when moving from C: to D: or E:.

command prompt change directory to desktop

Use the full path to the Desktop, such as cd /D C:\Users\Alex\Desktop. If you are already under the same user profile, cd Desktop also works. The full path is better when you are unsure where the prompt started.

command prompt change directory up one level

Type cd .. to move up one directory. If you need to go back farther, chain the segments, such as cd ..\... This is the fastest way to recover after landing in the wrong folder.

developer command prompt for vs 2022 change directory

Use the same cd rules, but remember that the Developer Command Prompt starts with Visual Studio tools loaded. If the folder is on another drive, use cd /D. If you only need to confirm location before building, run dir first.