The Basic Command to Move Between Folders
To change directories in Command Prompt, type cd followed by a space and the folder path you want to enter, then press Enter. For example, cd Documents moves you into your Documents folder. The folder must exist in your current location, or you need to provide the full path from your computer's root drive.
Command Prompt always shows your current location in the prompt line itself — usually something like C:\Users\YourName>. When you change directories, that path updates to show where you are. This tells you whether the command worked and where you'll be when you run other commands.
Key Takeaways
- The cd command moves you into a folder; type cd .. to go up one level to the parent folder.
- Use the full path starting from your drive letter (like C:\Users\YourName\Documents) if the folder is not in your current location.
- Type dir to list all folders in your current location so you know which ones you can enter.
- Folder names with spaces need quotes around them, like cd "Program Files".
- You cannot change to a folder on a different drive with cd alone; type the drive letter first, like D:, then use cd.
Moving Up One Level or to the Parent Folder
Type cd .. (cd followed by two periods) to move up one level to the parent folder. If you are in C:\Users\YourName\Documents, running cd .. takes you to C:\Users\YourName. You can chain multiple levels by typing cd ..\.. to go up two folders at once.
This is useful when you need to navigate sideways through your folder structure. For example, if you are in Documents and need to get to Downloads (which is in the same parent folder), you would type cd .. first, then cd Downloads.
Using Full Paths Instead of Relative Paths
A relative path assumes you are starting from your current location — cd Documents only works if Documents exists where you are right now. A full path starts from your drive letter and works no matter where you are. For example, cd C:\Users\YourName\Documents\Projects takes you directly to Projects regardless of your current folder.
Full paths are more reliable when you are writing scripts or commands that need to work consistently. They are also necessary when the folder you want is buried several levels deep and you do not want to navigate step by step. Copy the path from File Explorer's address bar and paste it into Command Prompt to avoid typing errors.
Handling Folder Names with Spaces
If a folder name contains spaces, wrap the entire path in double quotes. For example, cd "Program Files" or cd "My Documents". Without the quotes, Command Prompt reads the space as the end of the command and tries to change to a folder called just "Program", which fails.
You can also use quotes around only the folder name if you are building a longer path: cd C:\Users\"My User"\Documents. Either approach works, but quoting the entire path is simpler and less error-prone.
Switching to a Different Drive
Command Prompt starts on your C: drive by default. To move to a different drive (like D: or E:), type just the drive letter followed by a colon, then press Enter. For example, type D: to switch to your D: drive. After that, use cd normally to navigate folders on that drive.
You cannot use cd alone to jump between drives — cd D:\Folder while on C: will not work. You must first type D: to switch drives, then use cd to enter folders on that drive. This is a common source of confusion for people new to Command Prompt.
Listing Folders in Your Current Location
Before you change directories, you often need to know what folders exist where you are. Type dir and press Enter to list all files and folders in your current location. The output shows folder names with <DIR> next to them, making them easy to spot. File names appear without that label.
You can also type dir /s to list all folders and subfolders recursively, though this produces a very long output if you have many nested folders. For a cleaner view, use dir /b to show just the names without extra details, or dir /ad to show only directories (folders) and skip files entirely.
Common Mistakes and How to Fix Them
The most common error is typing a folder name that does not exist in your current location. Command Prompt responds with "The system cannot find the path specified." Check the spelling, use dir to see what folders are actually there, or provide the full path from your drive letter.
Another frequent mistake is forgetting quotes around folder names with spaces, or forgetting to switch drives before using cd. If a command does not work, look at the error message — it usually tells you what went wrong. Copy the exact folder name from dir output and paste it into your cd command to avoid typos.
Frequently Asked Questions
How do I go back to the previous folder I was in?
Command Prompt does not have a built-in "back" button like a web browser. Use cd .. to go to the parent folder, or type the full path of the folder you want to return to. Some advanced users create batch scripts to track history, but the standard approach is to navigate manually or use the full path.
Can I change to a folder on a network drive or external hard drive?
Yes, if the drive is mapped as a letter (like Z:), use the same method: type the drive letter and colon first, then use cd to navigate folders. If the drive is not mapped, you can map it in File Explorer or use the net use command in Command Prompt, then navigate normally.
What does "access denied" mean when I try to change directories?
This means your user account does not have permission to enter that folder. You may need to run Command Prompt as Administrator, or the folder owner may need to grant your account access. Right-click Command Prompt and select "Run as Administrator" to try again.
How do I change directories to a folder I just created?
Use dir to confirm the folder appears in your current location, then type cd followed by the folder name. If you created it in a different location, use the full path. New folders are immediately available for navigation once they exist on disk.