The cd command moves you between folders
To change directories in Command Prompt, type cd followed by a space and the folder name or path you want to enter, then press Enter. The folder you name must exist inside your current location, or you must give the full path from the root of your drive. Command Prompt will not move you to a folder that does not exist — it will show an error instead.
The most common mistake is typing a folder name that has a space in it without quotes. If you want to enter a folder called "My Documents", you must type cd "My Documents", not cd My Documents. Without the quotes, Command Prompt reads "My" as the folder name and ignores the rest.
You can see which folder you are currently in by looking at the line that starts with your drive letter — usually C:\Users\YourName> or similar. Everything after the drive letter and before the > symbol is your current path.
Key Takeaways
- Type cd FolderName to enter a folder that exists in your current location, then press Enter.
- Folder names with spaces must be wrapped in quotes: cd "My Documents", not cd My Documents.
- Type cd .. to move up one level to the parent folder, or cd \ to jump to the root of your drive.
- You can type a full path from any location: cd C:\Users\YourName\Desktop will take you directly there regardless of where you started.
- Type dir to list all folders in your current location so you know what names to type.
Moving up one level or to the root
To move backward to the folder that contains your current folder, type cd .. (that is the letters c and d, a space, and two periods). This is called the parent directory. If you are in C:\Users\YourName\Desktop, typing cd .. takes you to C:\Users\YourName.
To jump all the way to the root of your drive — the top level — type cd \ (c, d, space, backslash). This takes you to C:\ or whichever drive letter you are on. From there you can navigate into any folder on that drive.
You can also chain these together. Typing cd ..\.. moves up two levels at once. Each pair of periods moves you up one folder.
Using the full path to jump anywhere
If you know the complete path to a folder, you can go there directly from anywhere without moving step by step. Type cd followed by the full path, starting with the drive letter. For example, cd C:\Users\YourName\Documents\ProjectFolder takes you straight to ProjectFolder no matter where you currently are.
This is faster when you know exactly where you want to go, but it requires you to type the entire path correctly. If any folder name in the path does not exist or is spelled wrong, Command Prompt will show an error and you will stay in your current location.
You can also use this method to switch to a different drive. Typing cd D:\ moves you to the root of your D drive (or whatever other drive letter you have). If you just type the drive letter with a colon, like D:, you move to that drive but stay in whatever folder you were in on that drive.
Listing folders so you know what to type
Before you change directories, you need to know what folders exist in your current location. Type dir and press Enter. Command Prompt will show a list of all files and folders in the current directory. Folders are marked with <DIR> on the left side of the listing.
The output can be long and scroll off the screen. If you want to see it one page at a time, type dir /p instead. Command Prompt will pause after each screen and wait for you to press a key before showing more.
Once you see the folder name you want, type cd followed by that exact name. Capitalization does not matter — cd Desktop and cd DESKTOP both work — but spelling and spaces must be exact.
Handling special characters and long folder names
Folder names with spaces, hyphens, parentheses, or other special characters can confuse Command Prompt. The safest approach is to wrap the entire folder name in double quotes. For example, cd "Program Files" or cd "My Project (2024)".
If a folder name is very long, you can use tab completion to avoid typing it all. Type the first few letters of the folder name and press Tab. Command Prompt will try to complete the name for you. If it guesses wrong, press Tab again to cycle through other matches. Once the name is correct, press Enter to change into that folder.
Tab completion also adds quotes automatically if the folder name contains spaces, so you do not have to type them yourself.
Troubleshooting when the command does not work
If you type a cd command and see "The system cannot find the path specified", the folder either does not exist, is spelled differently, or is not inside your current location. Check the spelling by typing dir first to see the exact folder names available.
If you are trying to reach a folder on a different drive, remember that you may need to switch drives first. Typing cd D:\FolderName will not work if you are on the C drive and the folder is on D. Instead, type D: first to switch to the D drive, then type cd FolderName.
If you see a message about access being denied, the folder exists but your user account does not have permission to enter it. This is a security restriction set by Windows or the folder owner. You may need to run Command Prompt as an administrator or ask the folder owner to grant you permission.
Frequently Asked Questions
Can I change to a folder that is inside a folder that is inside my current folder?
Yes. Type the path with backslashes between folder names: cd Folder1\Folder2\Folder3. Command Prompt will move through each level in order. If any folder in the chain does not exist, you will get an error and stay where you are.
What does the tilde symbol (~) mean in a path?
The tilde is not used in Windows Command Prompt paths. You may be thinking of Linux or Mac terminals, where it represents the home folder. In Windows, use the full path or navigate step by step with cd commands.
How do I go back to the folder I was just in?
Command Prompt does not have a built-in "back" button like a file browser. You must type the path to the folder you want. If you remember the path, type cd followed by it. Otherwise, type cd .. to go up one level and navigate from there.
Can I use forward slashes instead of backslashes in paths?
Modern versions of Windows Command Prompt accept both forward slashes and backslashes in paths. However, backslashes are the Windows standard and more reliable across all versions. Stick with backslashes to avoid confusion.
What if a folder name starts with a number or special character?
Folder names starting with numbers work fine without quotes: cd 2024Projects is valid. Names starting with special characters like @ or # should be wrapped in quotes: cd "@Archive". When in doubt, use quotes.