The cd command moves you between folders

To change directory in Command Prompt, type cd followed by a space and the folder name or path you want to enter, then press Enter. For example, cd Documents moves you into your Documents folder. The folder name is case-insensitive on Windows, so cd documents and cd Documents work the same way.

Command Prompt always shows your current location in the prompt line before the cursor. On most Windows systems, it looks like C:\Users\YourName> or C:\Users\YourName\Documents>. When you change directory successfully, this path updates to show where you are now.

Key Takeaways

  • Type cd FolderName to enter a folder one level deeper, or cd .. to go back one level to the parent folder.
  • Use the full path like cd C:\Users\YourName\Documents\ProjectFolder to jump directly to any folder from anywhere.
  • Type cd /d D: to switch to a different drive letter, such as moving from your C: drive to a USB drive or external hard drive.
  • Use dir to list the folders inside your current location so you know what folder names to type.
  • Folder names with spaces need quotes around them, like cd "My Documents".

Moving one folder at a time with folder names

The simplest way to navigate is to move one folder deeper at a time. Type cd, a space, and the exact name of the folder you want to enter. If you are in C:\Users\YourName and you type cd Documents, you move into C:\Users\YourName\Documents.

You can only move into folders that exist inside your current location. If you try to enter a folder that is not there, Command Prompt shows an error: "The system cannot find the path specified." Use the dir command first to see what folders are available. Type dir and press Enter to list everything in your current folder.

Folder names are not case-sensitive in Windows, so capitalization does not matter. cd downloads, cd Downloads, and cd DOWNLOADS all work the same way.

Going back up with the parent directory shortcut

To move back up one level to the folder that contains your current folder, type cd .. (that is two periods with no space between them) and press Enter. If you are in C:\Users\YourName\Documents\ProjectFolder, typing cd .. takes you back to C:\Users\YourName\Documents.

You can chain multiple .. commands together to go back several levels at once. Type cd ..\.. to go back two levels, or cd ..\..\.. to go back three levels. Each pair of periods represents one level up.

If you are at the root of your drive, like C:\, typing cd .. does nothing because there is nowhere higher to go.

Jumping directly to any folder with the full path

Instead of moving one folder at a time, you can type the complete path to jump directly to any folder. Type cd followed by the full path from the drive letter all the way to your destination. For example, cd C:\Users\YourName\Documents\ProjectFolder\Subfolder takes you straight there, no matter where you started.

This method is faster when you know exactly where you need to go. You do not have to navigate through intermediate folders. The path must be typed exactly as it exists on your computer, including all backslashes and folder names.

If any folder name in the path contains a space, wrap the entire path in double quotes: cd "C:\Users\YourName\My Documents\Project Folder". Without the quotes, Command Prompt stops reading at the first space and shows an error.

Switching to a different drive letter

If you have multiple drives on your computer — such as C: for your main drive, D: for a second hard drive, or E: for a USB drive — you cannot reach them by typing just the folder name. You must use the /d flag to change drives. Type cd /d D: to switch to your D: drive, or cd /d E: to switch to a USB drive.

Without the /d flag, typing cd D: alone does not work. Command Prompt shows an error or does nothing. The /d flag tells Command Prompt to change both the directory and the drive at the same time.

Once you are on the new drive, you can navigate its folders normally with cd FolderName or cd ... If you want to go to a specific folder on a different drive in one command, type cd /d D:\FolderName\SubfolderName.

Handling folder names with spaces and special characters

Folder names that contain spaces cause problems in Command Prompt because spaces are used to separate commands from their options. If you try to type cd My Documents without quotes, Command Prompt reads only "My" as the folder name and ignores "Documents," then shows an error.

Wrap any folder name or path with spaces in double quotes. Type cd "My Documents" or cd "C:\Users\YourName\My Documents\My Project". The quotes tell Command Prompt to treat everything inside as a single folder name, spaces and all.

Folder names with other special characters like parentheses, ampersands, or hyphens usually work without quotes, but using quotes is always safe. If you are unsure, add quotes and Command Prompt will handle it correctly.

Using tab completion to avoid typing mistakes

Command Prompt includes a feature called tab completion that finishes folder names for you. Type cd, a space, and the first few letters of the folder name, then press the Tab key. Command Prompt fills in the rest of the name automatically. If multiple folders start with the same letters, pressing Tab cycles through them one at a time.

This method is faster and prevents spelling mistakes. If you type cd Doc and press Tab, Command Prompt completes it to cd Documents (or whichever folder actually exists). Press Enter to move into that folder.

Tab completion works with full paths too. Type cd C:\Users\, press Tab to cycle through user account names, then continue typing and pressing Tab to navigate deeper into the path.

Frequently Asked Questions

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

This error appears when the folder name or path you typed does not exist in your current location. Check the spelling of the folder name, including capitalization if you are copying from somewhere. Use dir to list the actual folder names in your current location, then type the cd command again with the correct name.

Can I use forward slashes instead of backslashes in paths?

Yes. Command Prompt accepts both cd C:\Users\YourName\Documents and cd C:/Users/YourName/Documents. Forward slashes work the same way as backslashes. Use whichever you find easier to type.

How do I go back to my home folder quickly?

Type cd %userprofile% to jump directly to your user home folder, which is usually C:\Users\YourName. The %userprofile% variable automatically expands to your actual home folder path, so you do not have to type the full path.

What if I type cd with no folder name?

Typing just cd and pressing Enter shows your current directory path. It does not move you anywhere. This is useful if you want to see exactly where you are without looking at the prompt line.

Can I change directory to a folder on a network drive?

Yes, if the network drive is mapped to a drive letter on your computer. Use cd /d Z: (or whichever letter your network drive uses) the same way you would switch to any other drive. If the network drive is not mapped, you can type the full network path in quotes, like cd "\\servername\sharename\foldername".