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. The letters stand for "change directory" — a directory is what Command Prompt calls a folder. After you press Enter, the prompt shows your new location. If the command does not work, the folder path is wrong or the folder does not exist in that location.

Command Prompt always starts in your user folder (usually C:\Users\YourName). From there you can move deeper into subfolders, back up to parent folders, or jump to any folder on your computer if you know the full path. The most common mistake is typing the folder name without the full path, or misspelling it.

Key Takeaways

  • Type cd FolderName to move into a folder one level deeper, or cd .. to move up one level to the parent folder.
  • Use the full path like cd C:\Users\YourName\Documents to jump directly to any folder without moving through each one.
  • Type dir to see all folders in your current location before you try to move into one.
  • Folder names with spaces need quotes around them, like cd "Program Files", or Command Prompt will misread the command.
  • Type cd / to jump to the root of your current drive, or cd C:\ to jump to the root of the C drive.

Moving one folder deeper with a straightforward folder name

If you are in C:\Users\YourName and you want to move into the Documents folder inside it, type cd Documents and press Enter. Command Prompt looks for a folder called Documents in your current location. If it finds it, the prompt changes to show C:\Users\YourName\Documents.

This works only if the folder is directly inside your current location. If Documents were nested two levels deeper, typing cd Documents would fail because Command Prompt cannot see it from where you are. You would need to move into the intermediate folder first, or use the full path instead.

Moving up to the parent folder

Type cd .. (that is two periods with no space between them) to move up one level to the folder that contains your current folder. If you are in C:\Users\YourName\Documents, typing cd .. moves you to C:\Users\YourName. Typing it again moves you to C:\Users, and again moves you to C:\.

This is useful when you have moved too deep and want to backtrack without typing out a long path. You can also type cd ..\.. to move up two levels at once, or cd ..\..\.. to move up three levels. Each pair of periods separated by a backslash moves you up one more level.

Jumping directly to any folder with the full path

Instead of moving through each folder one at a time, you can jump straight to any folder by typing its full path. The full path starts with the drive letter (usually C:) followed by a backslash, then each folder name separated by backslashes. For example, cd C:\Users\YourName\Documents\MyProject takes you directly to the MyProject folder no matter where you started.

To find the full path of a folder, open File Explorer, navigate to the folder, and look at the address bar at the top. Copy the path from there and paste it into Command Prompt after cd. This is faster than typing it by hand and avoids spelling mistakes.

Handling folder names with spaces

If a folder name contains spaces, you must put the entire path in quotation marks or Command Prompt will misread it. For example, if you have a folder called My Documents, typing cd My Documents fails because Command Prompt thinks you are trying to move to a folder called My, then run a separate command called Documents. Instead, type cd "My Documents" with quotes around the name.

The same rule applies to full paths with spaces. Type cd "C:\Program Files\MyApp" rather than cd C:\Program Files\MyApp. If even one folder name in the path has a space, the entire path needs quotes.

Checking what folders exist before you move

If you are not sure what folders are in your current location, type dir and press Enter. Command Prompt lists every file and folder in your current location. Folders are marked with <DIR> on the left side. Once you see the folder name spelled correctly, you can type cd followed by that exact name.

This prevents the most common error: typing a folder name that does not exist or misspelling it. If you type cd with a name that does not exist, Command Prompt shows an error message like "The system cannot find the path specified." Running dir first confirms the folder name before you try to move into it.

Switching between different drives

If your computer has more than one drive (like C: and D:), typing cd D:\FolderName moves you to a folder on the D drive. However, just typing cd D:\ does not always work — you may need to type D: on its own line first to switch to that drive, then type cd FolderName to move into a folder on it.

If you type cd D:\FolderName and nothing happens, try typing D: first to switch drives, then check your location by looking at the prompt. Once the prompt shows D:\, you can navigate folders on that drive normally.

Frequently Asked Questions

What does "The system cannot find the path specified" mean?

The folder path you typed does not exist or is spelled wrong. Type dir to see what folders are actually in your current location, then check the spelling of the folder name you want. If the folder is on a different drive, make sure you included the drive letter like C: at the start of the path.

Can I use forward slashes instead of backslashes?

In newer versions of Windows Command Prompt, forward slashes sometimes work, but backslashes are the standard. Stick with backslashes to avoid confusion: cd C:\Users\YourName\Documents instead of cd C:/Users/YourName/Documents. Backslashes always work.

How do I get back to the C drive root?

Type cd \ to jump to the root of your current drive, or type cd C:\ to jump directly to the root of the C drive. The prompt will show C:\ with nothing after it, meaning you are at the top level of that drive.

What if I type a folder name but nothing changes?

The folder name is likely misspelled or does not exist in your current location. Type dir to see the actual folder names, paying attention to capitalization and spaces. Folder names in Command Prompt are not case-sensitive, but the spelling must match exactly.