How to Change the Folder in Command Prompt (Windows Guide)
Navigating folders in Command Prompt is one of the most fundamental skills for anyone working in the Windows terminal. Whether you're running scripts, managing files, or troubleshooting system issues, knowing how to move between directories quickly and confidently makes everything else easier.
What "Changing the Folder" Actually Means
In Command Prompt, your working directory is the folder you're currently "inside." Every command you run operates relative to that location by default. When you open Command Prompt, it typically starts in your user profile folder — something like C:UsersYourName.
Changing the folder means telling the terminal to point to a different location, so that commands you type next apply there instead of where you started.
The Core Command: cd
The command you need is cd, which stands for change directory. It's been part of Windows since the earliest versions of DOS and works the same way today.
Basic syntax:
cd [path] You replace [path] with the folder you want to navigate to.
Navigating to a Specific Folder
If you want to go to a folder on the same drive, type the path directly:
cd C:UsersYourNameDocuments After pressing Enter, your prompt will update to reflect the new location.
Moving Up One Level
To go back one folder (up to the parent directory), use two dots:
cd .. So if you're in C:UsersYourNameDocuments, running cd .. takes you to C:UsersYourName.
Moving Up Multiple Levels at Once
You can chain the double-dot notation:
cd .... This moves you up two levels in a single command.
Navigating to a Subfolder
If you're already in C:UsersYourName and want to jump into a subfolder, you don't need the full path — just the subfolder name:
cd Documents Switching Between Drives 🖥️
This is where many beginners get tripped up. The cd command alone won't switch you between drives (for example, from C: to D:). You need to type the drive letter followed by a colon:
D: Press Enter, and your prompt jumps to whatever the working directory was on that drive. Then use cd normally to navigate within it.
If you want to switch drives and jump straight to a folder in one command, use the /d flag:
cd /d D:ProjectsMyFolder The /d flag tells Command Prompt to change the drive and directory at the same time.
Handling Folders With Spaces in the Name
Folder names with spaces will break a plain cd command unless you wrap the entire path in quotation marks:
cd "C:UsersYourNameMy Documents" Without the quotes, Command Prompt reads everything after the first space as a separate argument and throws an error.
Useful Navigation Shortcuts
| Command | What It Does |
|---|---|
cd .. | Move up one folder level |
cd | Jump to the root of the current drive |
cd %USERPROFILE% | Go directly to your user profile folder |
cd %TEMP% | Navigate to the Windows temp folder |
dir | List all files and folders in current directory |
The %USERPROFILE% and %TEMP% examples use environment variables — built-in shortcuts Windows maintains automatically. You can use any environment variable in a path this way.
Using Tab Autocomplete to Navigate Faster ⚡
You don't have to type full folder names manually. After typing cd and the beginning of a path, press Tab to autocomplete the folder name. Press Tab again to cycle through other matches. This is especially useful for long paths or folders with complex names.
For example:
cd C:Pro[TAB] Might complete to C:Program Files or C:Projects, depending on what exists on your system.
Absolute vs. Relative Paths
Understanding the difference between these two path types affects how you write cd commands:
- Absolute path — starts from the drive root, works regardless of your current location. Example:
cd C:WindowsSystem32 - Relative path — starts from your current folder. Example: if you're in
C:UsersYourName, typingcd Documentsuses a relative path.
Relative paths are faster to type but only work correctly when you're already in the right parent folder.
When the Command Doesn't Work
A few common reasons cd might fail:
- Typo in the path — Command Prompt won't guess. The path must match exactly, including correct capitalization of folder names (though Windows paths are not case-sensitive, extra characters or spaces still matter).
- Missing quotation marks — required whenever a folder name contains spaces.
- Trying to switch drives without
/d— usecd /dor switch the drive letter separately. - Folder doesn't exist — use
dirto list what's actually in your current location and verify the folder name.
How Your Setup Affects the Experience
The commands above work across all modern versions of Windows, but a few factors shape how smooth the experience is in practice:
- Windows Terminal vs. legacy Command Prompt — newer Windows Terminal (available from Windows 10 and 11) supports tabs and better autocomplete behavior, while the older
cmd.exewindow is more limited in display but functionally identical forcd. - User account permissions — navigating to certain system folders may be blocked depending on whether you're running Command Prompt as a standard user or as an administrator. Right-clicking and selecting "Run as administrator" opens a session with elevated access.
- PowerShell vs. CMD — PowerShell uses the same
cdcommand (it's aliased toSet-Location), but handles some paths and special characters differently. If you're copying commands between environments, results may vary.
How you use these commands day-to-day depends heavily on what you're trying to accomplish and how your own system is configured — which is worth keeping in mind as you build out your workflow.