The cd command moves you between folders

To change the directory in Command Prompt, type cd followed by a space and the folder path you want to move into, then press Enter. Command Prompt will move you to that location, and your prompt will show the new path. This is the core action — everything else is learning which path to type.

The reason you change directories is practical: when you're in a folder, Command Prompt can find files there without you typing the full path each time. If you want to run a program, edit a file, or list what's inside a specific folder, being in that directory first makes the commands shorter and faster.

Key Takeaways

  • Type cd followed by a space and the folder name or path, then press Enter to move into that directory.
  • Use cd .. (with two dots) to move up one level to the parent folder.
  • Type cd \ to jump to the root of your current drive, or cd C:\ to switch to a different drive entirely.
  • If a folder name has spaces, wrap the entire path in quotation marks so Command Prompt reads it as one location.
  • Type dir to see what folders exist in your current location before you try to move into one.

Moving into a folder one level down

If you want to move into a folder that's inside your current directory, type cd followed by the folder name. For example, if you're in C:\Users\YourName and you want to move into the Documents folder, type cd Documents and press Enter. Your prompt will now show C:\Users\YourName\Documents.

You can see what folders exist in your current location by typing dir and pressing Enter. Command Prompt will list every file and folder there. Look for entries marked <DIR> — those are the folders you can move into with the cd command.

Moving up to the parent folder

To move up one level — from a folder back into the folder that contains it — type cd .. (cd followed by a space and two periods) and press Enter. If you're in C:\Users\YourName\Documents, this command takes you back to C:\Users\YourName.

You can chain this together if you need to move up multiple levels. Type cd ..\.. to move up two levels, or cd ..\..\.. to move up three levels. Each pair of dots represents one level up the folder tree.

Jumping to a specific path all at once

Instead of moving one folder at a time, you can type the entire path and move there directly. Type cd followed by the full path — for example, cd C:\Users\YourName\Documents\Projects — and press Enter. Command Prompt will move you straight to that location if the path exists.

If the path doesn't exist, Command Prompt will show an error message like "The system cannot find the path specified." This usually means you typed the path wrong, the folder doesn't exist, or the folder is on a different drive. Double-check the spelling and try again.

Handling folder names with spaces

If a folder name contains spaces — like "My Documents" or "Program Files" — you must wrap the entire path in quotation marks. Type cd "C:\Program Files" instead of cd C:\Program Files. Without the quotes, Command Prompt reads the space as the end of the command and tries to move into a folder called just "C:\Program" which doesn't exist.

This applies whether you're typing a full path or just a folder name. If you're in a directory and want to move into a subfolder called "My Folder", type cd "My Folder" with the quotes included.

Switching to a different drive

If your computer has multiple drives — like C:, D:, or E: — and you want to move to a folder on a different drive, type the drive letter followed by a colon. For example, type D: and press Enter to switch to the D drive. Your prompt will change to show D:\.

Once you're on the new drive, use the cd command the same way you would on C:. You can also jump directly to a folder on another drive by typing the full path: cd D:\Backups\Photos will move you to the Photos folder on the D drive in one step.

Returning to the root directory

The root directory is the top level of your drive — the folder that contains all other folders. To move there, type cd \ (cd followed by a backslash) and press Enter. Your prompt will show just the drive letter and a backslash, like C:\.

From the root, you can see the main system folders like Windows, Program Files, and Users. Most of your work happens deeper inside these folders, but moving to the root is useful when you need to navigate to a completely different part of your drive or when you're troubleshooting and need a clean starting point.

Frequently Asked Questions

What's the difference between cd and cd .?

cd .. moves you up one level to the parent folder. A single dot (cd .) doesn't move you anywhere — it refers to your current directory. You'll rarely use cd . in practice, but it's useful in scripts or when you need to refer to the current location explicitly.

Can I use forward slashes instead of backslashes?

Yes. Command Prompt accepts both cd C:\Users\YourName and cd C:/Users/YourName. Most Windows documentation shows backslashes, but forward slashes work the same way. Pick whichever is easier for you to type.

What if I type a path that doesn't exist?

Command Prompt will display "The system cannot find the path specified." Check that you spelled the folder names correctly, that the folder actually exists, and that you're looking on the right drive. Use dir to see what folders are available in your current location.

How do I see the full path of where I am right now?

Your current path is always shown in the prompt itself. If your prompt reads C:\Users\YourName\Documents>, you are in the Documents folder. You can also type cd with no path and press Enter — Command Prompt will print your current directory.