The cd command moves you between folders in Command Prompt
To change folders in Command Prompt, type cd followed by the folder path you want to enter, then press Enter. The cd command stands for "change directory" — it is the tool that moves you from one folder to another without leaving Command Prompt open. Once you change to a folder, all the commands you run will work inside that folder unless you move again.
The folder path can be a subfolder inside your current location, or a full path starting from your drive letter. Command Prompt shows you where you are right now in the prompt itself — it displays your current folder path before the blinking cursor, so you always know your location.
Key Takeaways
- Type cd foldername to enter a subfolder, or cd C:\Users\YourName\Documents to jump to any folder using its full path.
- Use cd .. to move up one level to the parent folder, or cd \ to jump to the root of your current drive.
- Type dir to list all folders in your current location so you know which folder names to type.
- Folder names with spaces need quotes around them: cd "Program Files" instead of cd Program Files.
- To switch to a folder on a different drive, type the drive letter first: D: moves you to the D drive, then use cd to navigate within it.
Moving to a subfolder inside your current location
If you want to enter a folder that is inside the folder you are currently in, type cd followed by the folder name. For example, if you are in C:\Users\YourName and you want to enter the Documents folder, type cd Documents and press Enter. Command Prompt will move into that folder, and the prompt will now show C:\Users\YourName\Documents.
You only need to type the folder name, not the full path, when the folder is directly inside your current location. If the folder name has spaces in it — like "My Documents" — wrap the name in quotes: cd "My Documents". Without the quotes, Command Prompt will think you are trying to enter a folder called "My" and will show an error.
Jumping to any folder using the full path
You can move to any folder on your computer in one step by typing the complete path. Type cd followed by the full path starting with the drive letter. For example, cd C:\Users\YourName\AppData\Local\Temp will take you directly to the Temp folder, no matter where you are right now.
To find the full path of a folder, open File Explorer, navigate to the folder you want, and look at the address bar at the top — that is the path you need to type. Copy it, paste it into Command Prompt after cd, and press Enter. If any folder name in the path has spaces, put quotes around the entire path: cd "C:\Program Files\My Application".
Moving up to the parent folder or the drive root
To go up one level to the folder that contains your current folder, type cd .. (cd followed by two periods) and press Enter. If you are in C:\Users\YourName\Documents, this command takes you to C:\Users\YourName. You can type it multiple times in a row to move up several levels at once.
To jump all the way to the root of your current drive, type cd \ (cd followed by a backslash) and press Enter. This takes you to C:\ if you are on the C drive, or D:\ if you are on the D drive. From there, you can navigate down into any folder on that drive.
Switching to a folder on a different drive
If the folder you want is on a different drive — like D: or E: — you need to switch drives first. Type the drive letter followed by a colon, like D:, and press Enter. Command Prompt will move to the D drive and show D:\ in the prompt. Then use the cd command to navigate to the folder you want on that drive.
You can also jump directly to a folder on another drive in one command by typing the full path including the drive letter: cd D:\Backups\Documents. This works the same way as jumping to a folder on your current drive — Command Prompt will switch drives and navigate to that folder in one step.
Listing folders so you know what to type
If you are not sure what folders exist in your current location, type dir and press Enter. This command lists all the files and folders in the folder you are currently in. Folders are marked with <DIR> at the end of the line, so you can see which names are folders and which are files.
Once you see the folder name you want, type cd followed by that name. If you see a folder called "Downloads" in the listing, type cd Downloads to enter it. The dir command is your way to explore what is available before you move, so you do not have to guess at folder names.
Fixing common mistakes
If you type a folder name that does not exist, Command Prompt shows "The system cannot find the path specified." This usually means the folder name is spelled wrong, or the folder is not inside your current location. Type dir to see the correct spelling of the folder, or use the full path if the folder is somewhere else on your computer.
If you type a folder name with spaces and forget the quotes, you will see the same error. Command Prompt reads the space as the end of the command and tries to find a folder with only the first word. Always use quotes around folder names that contain spaces: cd "Program Files", not cd Program Files. If you are still stuck, type cd \ to go to the drive root and start over with a full path.
Frequently Asked Questions
What is the difference between cd and cd ..
cd by itself does nothing — you need to type a folder name or path after it. cd .. (with two periods) moves you up one level to the parent folder. The two periods are a shortcut that means "the folder above this one," so you do not have to type the full path.
Can I type a folder path with forward slashes instead of backslashes?
Yes. Command Prompt accepts both cd C:\Users\YourName\Documents and cd C:/Users/YourName/Documents. Most people use backslashes because that is how Windows displays paths, but forward slashes work too. Pick whichever is easier for you to type.
How do I go back to the folder I was just in?
Command Prompt does not have a built-in "back" button like a web browser. You have to navigate manually using cd or cd ... If you remember the path, type it. If you do not, type cd \ to go to the drive root, then navigate from there, or close Command Prompt and open a new window.
What if the folder path is really long and I do not want to type it all?
You can copy the path from File Explorer and paste it into Command Prompt. Open File Explorer, navigate to the folder, click the address bar at the top, press Ctrl+C to copy the path, then go to Command Prompt, type cd, press Ctrl+V to paste, and press Enter. This is faster than typing a long path by hand.
Does changing folders in Command Prompt affect my regular file system?
No. Changing folders in Command Prompt only changes where Command Prompt is looking — it does not move, delete, or change any files. You are just telling Command Prompt which folder to work in for the commands you run next. Your files stay exactly where they are.