The cd command moves you between folders in Command Prompt

To change folders in Command Prompt, type cd followed by a space and the folder path, then press Enter. For example, cd Documents moves you into your Documents folder. The cd command stands for "change directory" — a directory is what Command Prompt calls a folder.

When you open Command Prompt, you start in your user folder (usually C:\Users\YourUsername). From there, you can move into any subfolder that exists inside it. The folder path tells Command Prompt exactly where to go. Understanding how paths work — and the difference between moving one folder at a time versus jumping directly to a distant folder — saves you from typing errors and gets you where you need to be faster.

Key Takeaways

  • Type cd FolderName to move into a folder that is inside your current location.
  • Type cd .. (two periods) to move up one level to the parent folder.
  • Type cd C:\FullPath\To\Folder to jump directly to any folder using its complete path.
  • Type dir to see what folders exist in your current location before you try to change into one.
  • Wrap folder names or paths containing spaces in quotes, like cd "My Documents".

Moving into a folder one level down

If you want to move into a folder that is directly inside your current location, type cd followed by the folder name. For example, if you are in C:\Users\YourUsername and you want to enter the Documents folder, type cd Documents and press Enter. Command Prompt will move you there and show the new path in the prompt line.

Folder names with spaces need quotes around them. If you have a folder called "My Files", type cd "My Files" instead of cd My Files. Without the quotes, Command Prompt will think you are trying to change into a folder called "My" and will show an error message saying the directory was not found.

You can also move into multiple nested folders at once by typing the path with backslashes between them. For example, cd Documents\Projects\Work moves you from your current location directly into the Work folder, as long as that exact path exists. This is faster than typing cd Documents, then cd Projects, then cd Work separately.

Moving back up to the parent folder

To move up one level to the folder that contains your current folder, type cd .. (that is the letters c and d, a space, and two periods). This takes you from your current location to the folder above it. If you are in C:\Users\YourUsername\Documents, typing cd .. moves you back to C:\Users\YourUsername.

You can chain multiple .. commands together to move up several levels at once. Typing cd ..\.. moves you up two levels. Typing cd ..\..\.. moves you up three levels. Each .. represents one level up in the folder structure. This is useful when you have navigated deep into nested folders and want to jump back quickly without typing out the full path.

Jumping directly to a folder using its full path

Instead of moving one folder at a time, you can jump directly to any folder by typing its complete path. Type cd followed by the full path starting from the drive letter. For example, cd C:\Users\YourUsername\Documents\Projects\Work takes you straight to the Work folder, no matter where you started.

If the path contains spaces, wrap the entire path in quotes: cd "C:\Users\YourUsername\My Documents\Active Files". Command Prompt will move you directly to that location in one step. This method is faster when you know exactly where you need to go and do not want to navigate through intermediate folders.

Changing to a different drive

If you have multiple drives (like C:, D:, or E:), you can move between them. Type just the drive letter followed by a colon, like D: or E:, and press Enter. Command Prompt will switch to that drive and show you the root folder of that drive in the prompt.

You can also combine a drive change with a folder change in one command. Type cd /d D:\FolderName to switch to drive D and move into a specific folder at the same time. The /d flag tells Command Prompt to change both the drive and the directory in a single step, which is more efficient than typing two separate commands.

Checking what folders exist before you move

If you are not sure what folders are inside your current location, type dir and press Enter. This shows you a list of all files and folders in the current directory. Folder names will have <DIR> next to them so you can tell them apart from files.

Once you see the folder names, you can type cd followed by the exact name of the folder you want to enter. This prevents errors from typos or trying to move into a folder that does not exist. The dir command is especially helpful when you are working in an unfamiliar part of your file system or when you cannot remember the exact spelling of a folder name.

Frequently Asked Questions

What does "directory not found" mean?

This error appears when the folder name you typed does not exist in your current location, or when you misspelled it. Type dir to see the correct folder names, then try the cd command again with the exact spelling.

Can I use forward slashes instead of backslashes in the path?

Yes. Command Prompt accepts both C:\Users\YourUsername\Documents and C:/Users/YourUsername/Documents. Use whichever is easier for you — both work the same way.

How do I go back to my user folder from anywhere?

Type cd %userprofile% and press Enter. This takes you directly to your user folder no matter where you are. The %userprofile% is a variable that Command Prompt recognizes as your home directory.

What if a folder name has special characters like parentheses or ampersands?

Wrap the folder name or path in quotes. For example, cd "Folder (2024)" or cd "Files & Documents". The quotes tell Command Prompt to treat the whole thing as a single folder name.

Can I change folders and run a command at the same time?

Yes. You can type cd FolderName && command to change into a folder and then run a command in that folder. The && tells Command Prompt to run the second part only if the first part succeeds.