The cd command moves you between folders in Command Prompt
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 name must exist in your current location, or you need to type the full path from your C: drive.
Command Prompt always shows your current location in the prompt line — usually something like C:\Users\YourName>. When you change directories, that path updates to show where you are. If you type a folder name that does not exist, Command Prompt returns an error message instead of moving you.
The most common mistake is typing a folder name without understanding where Command Prompt is looking for it. It only searches inside your current folder, not your entire computer. If you want to jump to a folder on a different drive or buried several levels deep, you need to type the complete path.
Key Takeaways
- Type cd FolderName to enter a folder that exists in your current location, then press Enter.
- Type cd .. (two periods) to move up one level to the parent folder.
- Type the full path starting with the drive letter — for example, cd C:\Users\YourName\Documents\Projects — to jump directly to a folder anywhere on your computer.
- Command Prompt shows your current location in the prompt line, so you always know where you are before typing the next command.
- Folder names with spaces need quotes around them: cd "My Documents" instead of cd My Documents.
Moving to a folder in your current location
When you open Command Prompt, you start in your user folder — usually C:\Users\YourName. From there, you can move into any folder that sits directly inside it by typing cd and the folder name.
Type cd Documents and press Enter. Command Prompt moves you into your Documents folder, and the prompt line changes to show C:\Users\YourName\Documents>. Now any command you run works on files in Documents, and you can move into subfolders inside Documents the same way.
If you type a folder name that does not exist in your current location, Command Prompt returns the message "The system cannot find the path specified." This means either the folder name is spelled wrong, or it is not inside your current folder. Check the spelling and try again, or use the full path method described below.
Moving up to the parent folder
To move back out to the folder that contains your current folder, type cd .. (two periods with a space before them) and press Enter. This moves you up one level in the folder structure.
If you are in C:\Users\YourName\Documents and type cd .., you move back to C:\Users\YourName. Type cd .. again and you move to C:\Users. You can type it multiple times in a row to climb back several levels quickly, though Command Prompt will not let you go higher than your drive root.
This is useful when you navigate into a folder and realize you need to work in a different folder nearby. Instead of typing the full path, you can back up one or two levels and then move into the folder you actually want.
Jumping directly to a folder using the full path
If you know the complete path to a folder, you can jump there in one command instead of moving through each folder one at a time. Type cd followed by the full path starting with the drive letter.
For example, type cd C:\Users\YourName\Documents\Projects\2024 and press Enter. Command Prompt moves directly to that folder, and the prompt shows the full path. This works even if that folder is on a different drive — type cd D:\Backups\Archive to move to a folder on your D: drive.
The full path must be exact. If you misspell any folder name or the folder does not exist, Command Prompt returns an error. Copy the path from File Explorer if you are unsure — right-click the folder, select Properties, and the path appears in the Location field.
Handling folder names with spaces
Folder names that contain spaces cause problems in Command Prompt because spaces normally separate commands from their options. If you type cd My Documents, Command Prompt thinks you are trying to move to a folder called "My" and then do something with "Documents."
To fix this, wrap the folder name in quotation marks: cd "My Documents". The quotes tell Command Prompt to treat the entire name as one folder. This works with both short names and full paths — for example, cd "C:\Program Files\My process".
If you are not sure whether a folder name has spaces, look at the prompt line or use the dir command to list the contents of your current folder. Folder names with spaces appear in the listing, and you can copy them into your cd command with quotes around them.
Switching between different drives
If your computer has multiple drives — like C: for your main drive and D: for an external drive or second hard drive — you can move between them using the full path method. Type cd D:\FolderName to jump to a folder on your D: drive.
You can also type just the drive letter followed by a colon, like D:, and press Enter. This switches to the D: drive and keeps you in the same relative folder if it exists there. For example, if you are in C:\Users\YourName\Documents and type D:, Command Prompt moves to D:\Users\YourName\Documents if that path exists on the D: drive.
The prompt line always shows which drive you are on, so you know whether you successfully switched. If you type a drive letter that does not exist on your computer, Command Prompt returns an error.
Frequently Asked Questions
What does the tilde (~) mean in a path?
The tilde represents your user home folder — usually C:\Users\YourName. Some systems and older documentation use it as shorthand, but modern Command Prompt on Windows does not recognize it. Use the full path or navigate from your current location instead.
Can I use forward slashes instead of backslashes in paths?
Command Prompt accepts both forward slashes (/) and backslashes (\) in paths, so cd C:/Users/YourName/Documents works the same as cd C:\Users\YourName\Documents. Backslashes are the Windows standard, but forward slashes are often easier to type.
How do I see what folders are in my current location?
Type dir and press Enter. Command Prompt lists all files and folders in your current location, showing their names and sizes. Folders are marked with <DIR> next to their names, so you can see which ones you can move into with the cd command.
What if I want to go back to the root of my drive?
Type cd \ (backslash only) and press Enter. This moves you to the root of your current drive — usually C:\. From there, you can navigate into any top-level folder. To go to the root of a different drive, type cd D:\ instead.
Why does Command Prompt say "Access is denied" when I try to change directories?
This means the folder exists but your user account does not have permission to enter it. This usually happens with system folders or folders owned by another user. You cannot change this permission from Command Prompt — you need to adjust folder properties in File Explorer or run Command Prompt as Administrator.