How to Use CMD to Open a Folder in Windows
The Windows Command Prompt (CMD) is one of the most direct ways to navigate your file system — no mouse clicks, no Explorer windows, just typed commands. Whether you're troubleshooting, automating tasks, or simply learning the command line, knowing how to open a folder in CMD is a foundational skill.
What "Opening a Folder" Means in CMD
In a graphical interface, double-clicking a folder opens it in File Explorer. In CMD, "opening a folder" typically means one of two things:
- Navigating into a folder so that CMD itself is operating from that directory
- Launching a folder in File Explorer directly from a CMD command
Both are useful, and which one you want depends entirely on what you're trying to do next.
Navigating Into a Folder Using the cd Command
The core command for folder navigation in CMD is cd — short for "change directory."
Basic Syntax
cd [path to folder] For example, to navigate to a folder called Projects on your C drive:
cd C:UsersYourNameDocumentsProjects Once you run this, CMD's working directory changes to that folder. Any subsequent commands — listing files, running scripts, executing programs — will reference that location.
Useful Variations
| Command | What It Does |
|---|---|
cd .. | Moves up one level to the parent folder |
cd | Jumps to the root of the current drive |
cd /d D:Folder | Changes drive and directory at the same time |
cd %USERPROFILE% | Navigates to your user home folder |
The /d flag is important. If you type cd D:Folder while on the C drive, CMD won't switch drives without it. This catches a lot of new users off guard.
Opening a Folder in File Explorer From CMD
If you want to pop open a graphical File Explorer window for a specific folder while working in CMD, use the start command:
start . The dot (.) refers to the current directory. This instantly opens that folder in File Explorer. You can also specify a full path:
start C:UsersYourNameDownloads Or use the explorer command directly:
explorer C:UsersYourNameDownloads Both approaches launch the familiar graphical folder view without leaving CMD.
Opening CMD Directly Inside a Folder 🗂️
Sometimes you want to go the other direction — start CMD already pointed at a specific folder, rather than navigating there afterward.
Three common methods:
From File Explorer: Navigate to the folder, click the address bar, type
cmd, and press Enter. CMD opens with that folder as the working directory.Shift + Right-click: Hold Shift and right-click a folder in File Explorer. On most Windows versions, you'll see "Open PowerShell window here" or "Open command window here" (the exact option depends on your Windows version).
From the Run dialog: Press
Win + R, typecmd, press Enter, then usecdto navigate manually.
Working With Paths That Contain Spaces
Folder names with spaces — like My Documents or Program Files — require quotation marks around the path:
cd "C:UsersYourNameMy Documents" Without the quotes, CMD interprets the space as a separator between two separate arguments and throws an error. This is one of the most common stumbling blocks for CMD newcomers.
Listing Folder Contents After Navigation
Once you've navigated into a folder, dir shows you everything inside it:
dir For a cleaner view that includes subdirectories and file sizes in a more readable format:
dir /w Or to list all files including hidden ones:
dir /a Variables That Affect How This Works for You 💡
CMD navigation is consistent across Windows versions in its basics, but a few factors shift the experience depending on your setup:
- Windows version: Older versions (Windows 7, 8) show "Open command window here" in right-click menus. Windows 10 and 11 default to PowerShell in that same menu — though you can restore the CMD option through Registry settings.
- User permissions: Some folders (like
C:WindowsSystem32) require elevated privileges. You'd need to open CMD as Administrator to navigate into and run commands within protected directories. - Folder depth and path length: Windows has a historical 260-character path length limit. Very deeply nested folders can cause unexpected errors in CMD, though this limit can be lifted in Windows 10 and 11 through group policy or Registry edits.
- Environment variables: Using shortcuts like
%USERPROFILE%,%APPDATA%, or%TEMP%in yourcdcommands makes navigation more portable across different user accounts and machines — useful if you're writing batch scripts others will run.
PowerShell vs CMD for Folder Navigation
PowerShell uses the same cd command for navigation and supports many of the same path conventions. The start . trick also works in PowerShell. However, PowerShell treats paths slightly differently in some edge cases, and its tab completion is more powerful — a factor worth considering if you're deciding which shell to build habits around.
Whether CMD suits your workflow better than PowerShell, or whether a combination of graphical and command-line navigation fits your process, depends on the kinds of tasks you're running, how often you work in the terminal, and how your scripts and tools are written.