The fastest way to open a directory

To open a folder in Command Prompt, type cd followed by the folder path, then press Enter. The letters "cd" stand for "change directory" — it moves you into that folder so you can see and work with the files inside.

If you know the exact path, the command looks like this: cd C:\Users\YourName\Documents. Replace "YourName" with your actual username and "Documents" with whichever folder you want to enter. After you press Enter, the prompt will show you are now inside that folder — the text at the beginning of the line will change to show your new location.

If you do not know the full path, you can find it by opening File Explorer, navigating to the folder you want, and copying the address from the address bar at the top. Then paste it into Command Prompt after typing cd.

Key Takeaways

  • The cd command moves you into a folder; type cd followed by the folder path and press Enter.
  • Windows paths use backslashes and usually start with a drive letter like C:\ — copy the path directly from File Explorer if you are unsure.
  • If a folder name has spaces, wrap the entire path in quotation marks: cd "C:\Program Files\Folder Name".
  • Type cd .. to move up one level to the parent folder, or cd \ to jump back to the root of your drive.
  • Use dir to list all folders and files in your current location before opening one.

Handling folder names with spaces

Folder names that contain spaces require special handling in Command Prompt. If you type a path with spaces but no quotation marks, Command Prompt will stop reading at the first space and treat the rest as a separate command, which causes an error.

The solution is to wrap the entire path in double quotation marks. For example, if you want to open a folder called "My Documents" on your C: drive, type: cd "C:\My Documents". The quotation marks tell Command Prompt to treat the whole thing as one path, spaces and all.

This applies whether the spaces are in the folder name itself or in any parent folder above it. If you copy a path from File Explorer and it contains spaces, straightforward add quotation marks around the entire path before pasting it into Command Prompt.

Moving between folders with relative paths

You do not always need to type the full path from the root of your drive. Once you are inside a folder, you can move to subfolders inside it by typing just the subfolder name. For example, if you are in C:\Users\YourName and you want to enter the Documents folder inside it, type cd Documents instead of the full path.

To move up one level to the parent folder, type cd .. (that is two periods). If you are in C:\Users\YourName\Documents and you type cd .., you will move back to C:\Users\YourName. You can chain these together: cd ..\.. moves up two levels.

To jump all the way back to the root of your drive, type cd \. This is useful when you have navigated deep into nested folders and want to start over from the top level.

Listing what is inside a folder before you open it

Before you open a folder, you may want to see what folders and files are inside it. Use the dir command to list everything in your current location. Type dir and press Enter, and Command Prompt will display all subfolders and files with their sizes and creation dates.

If you want to see what is inside a folder without opening it first, type dir followed by the folder path. For example, dir C:\Users\YourName\Documents will show you the contents of Documents without moving you into it. This is helpful when you are deciding which folder to open next.

The output can be long if the folder contains many files. You can scroll up in Command Prompt to see earlier results, or you can narrow the list by typing dir /s to search through subfolders as well.

Opening a folder from File Explorer directly

If you already have a folder open in File Explorer and want to open Command Prompt at that exact location, you can skip typing the path altogether. In File Explorer, click the address bar at the top (where the folder path is shown), type cmd, and press Enter. Command Prompt will open with that folder as your current location.

Alternatively, right-click inside the folder in File Explorer, look for an option that says "Open in Terminal" or "Open Command Window Here" (the exact wording depends on your Windows version), and click it. Command Prompt will launch already positioned in that folder.

This method is faster than typing paths and eliminates the risk of typos. It is especially useful when you are working with deeply nested folders or paths with many special characters.

Troubleshooting common errors

If you type a path and see the error "The system cannot find the path specified", the folder either does not exist at that location or you have misspelled the path. Double-check the spelling and verify the drive letter is correct. Copy the path directly from File Explorer to avoid typos.

If you see "The filename, directory name, or volume label syntax is incorrect", you likely have a space in the path without quotation marks. Wrap the entire path in double quotes and try again. Another common cause is using forward slashes instead of backslashes — Windows Command Prompt requires backslashes in paths.

If Command Prompt says "Access is denied", the folder exists but your user account does not have permission to open it. This usually happens with system folders or folders owned by another user. You may need to run Command Prompt as administrator or contact your system administrator for access.

Frequently Asked Questions

What is the difference between cd and dir?

cd moves you into a folder so it becomes your current location. dir shows you what is inside a folder without moving you into it. Use cd when you want to work inside a folder; use dir when you just want to see what is there.

Can I open a folder on a different drive like D: or E:?

Yes. If the folder is on a different drive, first type the drive letter followed by a colon, like D:, and press Enter. Then type cd followed by the folder path. For example, D: then cd \Folder Name. Some versions of Windows let you type both in one command: cd /d D:\Folder Name.

What if I only know part of the folder name?

Use the dir command to list folders in your current location, then look for the one you want. Once you find the exact name, type cd followed by that name. If you are searching across many folders, you can type dir /s /b to list all subfolders recursively, though this can produce a very long list.

Do I need to type the full path every time?

No. Once you are inside a folder, you can navigate to subfolders by typing just their names. You only need the full path when you are jumping to a folder that is not inside your current location. Using relative paths like cd .. is faster for moving between nearby folders.

Why does my path have backslashes when I copy it from File Explorer?

Windows uses backslashes in file paths by default. Command Prompt expects backslashes, so this is correct. If you ever see forward slashes in a path (which can happen if you copy from certain programs), replace them with backslashes before using the path in Command Prompt.