Use cd with a path to switch folders in Command Prompt; add /d to jump drives too.
If you came here asking “how can i change directory in command prompt?”, you’re really asking how the cd (or chdir) command reads paths and how to move between folders and drives without friction. The good news: once you learn a handful of patterns—absolute paths, relative steps, drive changes, quoting, and a few helpers—you’ll fly. The cd command can both display the current folder and switch to another one; it shares the same behavior as chdir.
How Can I Change Directory In Command Prompt? Core Ways
Quick check: Start with the basics. Open cmd, then use these core moves to change location cleanly. Each line shows the command followed by what it does.
- Show current folder — Run
cdwith no arguments to print the current drive and directory. - Change using an absolute path — Type
cd C:\Projects\Siteto jump straight to that folder on the same drive. - Go up one level — Use
cd ..to move to the parent directory. Repeat it to climb more levels. - Jump to the drive root — Use
cd \to land at the root of the current drive. - Change drive and folder in one step — Add
/d:cd /d D:\Work\Docs. Without/d,cdwon’t switch drives. - Use
chdirinterchangeably —chdirmirrorscd. Pick either; behavior is the same.
Deeper fix: When paths have spaces, wrap the target in quotes, like cd "C:\Program Files\Git". This avoids misreads.
Change Directory In Cmd With Paths And Drives
Windows paths follow clear rules, and cd respects them. Learn these and you’ll never fight the prompt again.
Use Absolute Paths For Direct Jumps
Type the full drive and folder path to land exactly where you want. cd C:\Users\Public\Pictures is direct and predictable. If you also need to switch drives, add /d or change the drive first by typing D: and pressing Enter.
Use Relative Paths For Short Hops
- Step up —
cd ..moves to the parent folder. Chain it likecd ..\..to go up two levels. - Step sideways — From
C:\Work\App,cd ..\Logssends you toC:\Work\Logs. - Reset to root —
cd \takes you toC:\(or the root of the current drive).
Handle Spaces And Symbols With Quotes
Paths like C:\Program Files need quotes. Use cd "C:\Program Files\WindowsApps". Without quotes, the space splits the argument, which breaks the command.
Use Environment Variables For Known Places
Quick win: Many common folders have variables. For a user’s home, run cd %USERPROFILE%. Use set to print variables you can reuse. Windows exposes many such variables, and they resolve to the right paths on each PC.
Work With Spaces, Quotes, And Special Folders
Real paths aren’t always tidy. Some live under “Program Files.” Some are deep. Some sit under hidden folders. These tips reduce friction while still using the same cd behavior.
Quote Once, Then Reuse With History
Type cd "C:\Program Files\Git\bin" once. After that, use the up arrow to recall it and tweak the tail if needed. The command history saves time when you need to hop back and forth between related folders.
Mix Variables With Relative Segments
From anywhere, cd %USERPROFILE%\Documents lands in your Documents folder under the current user. That pattern stays stable across machines because the variable points to the right base path on each system.
Keep Paths Short With Drive Changes
Switch to a drive with E: (Enter), then use shorter relative steps like cd Games\Mods. If you want one move that changes both the drive and folder, use cd /d E:\Games\Mods.
Switch Across Drives And Network Locations
Local drives are simple. Network shares add a twist. cd does not keep a UNC path (\\server\share\folder) as the current directory. That’s why you may see the message “CMD does not support UNC paths as current directories.” Use pushd to map a temporary drive letter and jump there in one step, then popd to clean up.
- Map and jump —
pushd \\filesvr\team\buildsassigns the highest free letter (starting from Z:) and switches into it. - Return and unmap —
popdreturns you to the previous folder and removes that temporary drive. - Avoid the UNC error —
pushdsidesteps the “UNC paths” message that plaincdwould trigger.
Quick check: If you typed a full drive path like cd D:\Media and nothing changed, add /d on that command or switch to D: first. cd alone doesn’t change drives unless you include /d.
Speed Up Navigation With Shortcuts
Once the basics feel natural, a few small tricks shave seconds off every move. These don’t change how cd works; they just reduce typing.
Use Tab To Complete Names
Type part of a folder name, press Tab, and Command Prompt fills the rest. Press Tab again to cycle through matches; Shift+Tab cycles backward. If Tab completion feels disabled on an older setup, the registry value that controls completion may be off. Set HKCU\Software\Microsoft\Command Processor\CompletionChar to 0x9 to restore Tab behavior.
Drag Paths Into The Window
Open File Explorer, drag a folder into the Command Prompt window, and the full path appears. Then press Enter to run the cd you typed plus that pasted path. This pairs well with quoting because Explorer inserts quotes when needed.
Bookmark With pushd/popd
Think of pushd as “jump there and remember this spot,” and popd as “go back and forget.” You can stack several spots by running pushd more than once. Each popd returns to the previous one and removes temporary drive letters created for network paths.
Use Built-In Help
Quick check: Need a refresher on flags? Run cd /?, chdir /?, or pushd /?. The built-in help prints syntax and notes straight from the system.
Common Cd Commands At A Glance
Keep this compact list handy. It covers the patterns you’ll use daily in the command prompt while changing folders and drives.
| Command | What It Does | When To Use It |
|---|---|---|
cd |
Prints the current directory. | Confirm where you are before a move. |
cd C:\Path\To\Folder |
Jumps to an absolute path on the same drive. | Direct hop to a known location. |
cd /d D:\Work |
Changes drive and directory in one step. | Move to another drive without typing the drive name first. |
cd .. |
Moves up one directory. | Back out of a subfolder. |
cd \ |
Moves to the root of the current drive. | Reset your position on the current drive. |
cd "%USERPROFILE%\Documents" |
Uses a variable to reach the user’s Documents. | Portable way to reach common folders. |
pushd \\server\share\team |
Maps a temp drive and changes to that network path. | Avoid the UNC path limit of cd. |
popd |
Returns to the previous location; removes temp drive. | Clean exit from a network hop. |
chdir |
Alias of cd with the same syntax. |
Use interchangeably with cd. |
Put It All Together With Real-World Moves
Here’s a tight set of moves you can reuse all day. They cover most navigation cases in Command Prompt and keep typing down.
- Jump straight to a work folder —
cd /d D:\Clients\Acme\Build. One step, even across drives. - Hop to a sibling folder — From
D:\Clients\Acme\Build, runcd ..\Deploy. Short and readable. - Reach your profile quickly —
cd %USERPROFILE%, thencd Downloads. The variable makes this portable. - Open a long path with spaces —
cd "C:\Program Files\Microsoft SQL Server\150\Tools\Binn". Quotes keep it intact. - Work on a share without mapping it manually —
pushd \\corp\builds\latest, do your work, thenpopd. Clean in, clean out. - Let Tab handle the precise folder name — Type
cd C:\Winthen press Tab until you land on the right match. - Use help when you forget a flag —
cd /?orpushd /?. Syntax and notes appear right in the console.
Troubleshooting: Why Didn’t My Location Change?
When cd seems unresponsive, it’s usually a small mismatch between the command and the target path. Run through these quick checks.
- You tried to switch drives without
/d— Add/dor change drives first by typing the drive letter plus a colon. - You used a UNC path with
cd— Usepushdto enter a network share andpopdto return. - The folder name had spaces — Wrap it in quotes:
cd "C:\My Data\Reports". - Tab didn’t complete names — On older configs the completion key might be disabled. Set
CompletionCharto0x9underHKCU\Software\Microsoft\Command Processor. - The path doesn’t exist — Run
dirto list folders, then Tab your way into the right one.
By now, the phrase “how can i change directory in command prompt?” should feel solved. You’ve got absolute and relative paths, quoting, variables for common folders, the /d flag for drive jumps, network shares via pushd/popd, and speed tricks like Tab completion. These moves rely on commands built into Windows and documented across the Microsoft references linked above, so you can trust them across versions.
