The Basic Command to Move Between Folders

To change folders in Command Prompt, type cd followed by a space and the folder path, then press Enter. The letters "cd" stand for "change directory." For example, if you want to move into a folder called "Documents," you would type cd Documents and press Enter. Command Prompt will then move you into that folder, and the prompt line will show your new location.

The folder name you type must match exactly what appears on your computer. If the folder name has spaces in it, put the entire path in quotation marks. For instance, to enter a folder named "My Files," type cd "My Files". Without the quotation marks, Command Prompt will only recognize the first word and return an error.

Key Takeaways

  • The cd command moves you into a folder; the folder name must match exactly what appears on your computer.
  • Folder names with spaces require quotation marks around the entire path.
  • Use cd .. to move up one level to the parent folder, or cd \ to jump to the root of your drive.
  • Type dir to see all folders and files in your current location before you move.
  • Full paths starting with a drive letter (like cd C:\Users\YourName\Documents) work from anywhere on your computer.

Moving Up to Parent Folders and the Root Drive

Sometimes you need to move backward instead of forward. Type cd .. (cd followed by two periods) to move up one level to the parent folder. If you are in C:\Users\YourName\Documents, typing cd .. takes you to C:\Users\YourName. Typing it again moves you to C:\Users, and once more takes you to C:\.

To jump directly to the root of your drive (the highest level), type cd \. This works on any drive. If you want to switch to a different drive entirely, type the drive letter followed by a colon, like D:, and press Enter. Command Prompt will then show you the root of that drive.

Viewing Folder Contents Before You Move

Before you change folders, it helps to see what folders exist in your current location. Type dir and press Enter to display a list of all files and folders. Folders appear with a <DIR> label next to their names. This list shows you the exact spelling and spacing of each folder name, which you need to type correctly in your cd command.

If the list is long and scrolls past your view, type dir /p to display it one page at a time. Press any key to see the next page. You can also type dir /w to show the list in a wider format with fewer details.

Using Full Paths to Jump Directly to Any Folder

Instead of moving step by step through folders, you can type the complete path from the root of your drive. This is called a full path or absolute path. For example, type cd C:\Users\YourName\Documents\Projects to move directly into the Projects folder, no matter where you are currently located.

Full paths always start with a drive letter and a colon (C:, D:, E:, and so on), followed by backslashes that separate each folder name. If any folder name contains spaces, wrap the entire path in quotation marks: cd "C:\Program Files\My Application". This method is faster when you know the exact location of the folder you want to enter.

Handling Folder Names with Special Characters

Folder names that contain spaces, hyphens, or parentheses require quotation marks around the path. For example, a folder named "Project (2024)" must be entered as cd "Project (2024)". Without the quotation marks, Command Prompt interprets the space or special character as the end of the command and returns an error.

If you are unsure about the exact name, use the dir command to display the folder list and copy the name exactly as it appears. You can also use tab completion: type the first few letters of the folder name and press Tab, and Command Prompt will attempt to complete the name for you. If multiple folders start with those letters, press Tab again to cycle through them.

Troubleshooting Common Errors

If you type a cd command and see "The system cannot find the path specified," the folder name or path does not match what is on your computer. Check the spelling, spacing, and capitalization. Use dir to see the exact folder names in your current location. If you are trying to reach a folder on a different drive, make sure you have switched to that drive first by typing the drive letter and colon.

If you see "Access is denied," you do not have permission to enter that folder. This is a security setting on your computer. Contact your system administrator or the person who manages your computer if you need access to a restricted folder. Some folders in Windows are protected and cannot be opened through Command Prompt without elevated permissions.

Frequently Asked Questions

Can I use forward slashes instead of backslashes in folder paths?

In modern versions of Windows Command Prompt, forward slashes (/) often work in place of backslashes (\). However, backslashes are the standard for Windows paths. For the most reliable results, use backslashes. If a forward slash does not work, switch back to a backslash and try again.

What does the tilde (~) symbol do in Command Prompt?

The tilde (~) is not commonly used in basic cd commands. In some contexts, it represents the user's home folder, but this is more common in other operating systems. In Windows Command Prompt, stick with full paths or relative paths using folder names and cd .. to navigate.

How do I change to a folder on a USB drive or external hard drive?

First, type dir at the root (C:\) to see all available drives listed with letters like D:, E:, or F:. Type the drive letter followed by a colon, such as E:, and press Enter. Then use cd to navigate to your folder on that drive, just as you would on your main hard drive.

Can I change folders using a partial path if I am already in a parent folder?

Yes. If you are in C:\Users and want to enter C:\Users\YourName\Documents, you can type cd YourName\Documents instead of the full path. Command Prompt will look for those folders starting from your current location. This is called a relative path and saves typing when you are already partway to your destination.