How to Open a Folder or File from CMD in Windows

Learn how to open folders and files from Command Prompt, navigate to a directory, and open CMD directly inside a folder in Windows.

Open a folder or file from CMD in Windows

If you want to know how to open a folder in CMD, Command Prompt lets you navigate to directories, open files, and launch File Explorer without using the Windows interface for every step. This can be useful when running commands, working with scripts, troubleshooting Windows, or following instructions that require you to work from a specific folder.

In this guide, you’ll learn how to navigate to a folder in CMD, open files, launch a folder in File Explorer, and open Command Prompt directly inside a folder.

How to Open a Folder in CMD

To open or move into a folder from Command Prompt, use the cd command, which stands for change directory:

  1. Open the Start menu and type CMD.
  2. Select Command Prompt.
  3. Type cd followed by the full path of the folder you want to open.
  4. Press Enter.

For example: cd "C:\Users\migue\Desktop\Camino Geek"

Open a folder in CMD using the cd command in Windows 11
Command Prompt in Windows 11 using the cd command to open a folder path.

If the command works, the prompt changes to the folder you entered. For folders whose names contain spaces, place the entire path inside quotation marks.

Microsoft documents the cd command and its available options in the official Windows command reference.

How to Navigate to a Folder in CMD

You can navigate through folders in Command Prompt using either a full path or a path relative to your current location.

Navigate Using a Full Path. If you know the complete location of the folder: Open Command Prompt, type cd followed by the full folder path and press Enter.

Example: cd "C:\Users\migue\Documents\Projects"

CMD will move directly to that directory.

Navigate to a Subfolder. If the folder is inside your current directory: Check the current path shown before the cursor, type cd followed by the subfolder name and press Enter.

For example: cd Documents
If the name contains spaces: cd "Project Files"

Go Back to the Parent Folder. To move one level up: Make sure Command Prompt is active, type cd .. and press Enter.

You can repeat the command to move farther up the folder structure.

List Files and Folders with dir. If you’re not sure what is inside the current directory, use the dir command: Navigate to the folder you want to inspect, type dir and press Enter.

List files and folders using the dir command in CMD on Windows
Command Prompt in Windows listing files and folders with the dir command.

CMD will display the files and subfolders in that location.

How to Open a File in CMD

You can also open a file directly from Command Prompt. If you are already inside the folder containing the file:

  1. Navigate to the correct folder using cd.
  2. Type the file name, including its extension.
  3. Press Enter.

For example: example-file.txt

Windows will open the file with the default application associated with that file type.

Open a File Using Its Full Path. You don’t need to navigate to the folder first if you know the full path:

  1. Open Command Prompt.
  2. Type the complete path to the file.
  3. Place the path inside quotation marks if it contains spaces.
  4. Press Enter.

For example: "C:\Users\migue\Desktop\Camino Geek\example-file.txt"

This is useful when you only need to open one specific file.

How to Open CMD in a Folder

If you already have a folder open in File Explorer, you can launch Command Prompt directly in that location instead of navigating there manually.

The easiest method is to use File Explorer’s address bar.

  1. Open File Explorer.
  2. Navigate to the folder where you want to use Command Prompt.
  3. Click the address bar at the top of the window.
  4. Type: cmd
  5. Press Enter.

Command Prompt will open with that folder already set as the current directory.

For example, if File Explorer is displaying: C:\Users\migue\Documents\Projects, CMD will open directly at: C:\Users\migue\Documents\Projects>

This is one of the quickest ways to open Command Prompt in a folder when you already know its location.

Command Prompt opened directly in a File Explorer folder in Windows 11
File Explorer and Command Prompt showing the same Projects folder path in Windows 11.

If Windows won’t start normally, you can also learn how to open Command Prompt from startup.

Launch a Folder in File Explorer from Command Prompt

You can also do the opposite: start in Command Prompt and open a folder visually in File Explorer.

Open a Specific Folder: Open Command Prompt, type start "" followed by the folder path and press Enter.

For example: start "" "C:\Users\migue\Desktop\Camino Geek"

Open a folder in File Explorer from CMD in Windows 11
Command Prompt opening a folder in File Explorer with the start command in Windows 11.

File Explorer will open directly to that folder.

The empty quotation marks after start are important when the path is enclosed in quotes because the first quoted value is otherwise interpreted as the window title.

Open the Current Folder. If you want to open the folder you are currently working in: Open or navigate to the desired directory in CMD, type start . and press Enter.

File Explorer will open the current folder.

Open the Parent Folder. To open the folder one level above your current location: In CMD, type start .. and press Enter.

The parent directory will open in File Explorer.

Common Problems When Navigating Folders in CMD

Most problems when using folder paths in Command Prompt are caused by a few simple issues.

The Path Contains Spaces. If a folder name contains spaces, wrap the path in quotation marks.

Incorrect: cd C:\Users\migue\Desktop\Camino Geek
Correct: cd "C:\Users\migue\Desktop\Camino Geek"

CMD Says the Path Cannot Be Found. Check that:

  1. The folder or file actually exists.
  2. The path is spelled correctly.
  3. You are using the correct drive letter.
  4. Paths containing spaces are enclosed in quotation marks.

The Folder Is on Another Drive. If you need to move from one drive to another, such as from C: to D:, you can use: cd /d "D:\Projects"

The /d option changes both the drive and the directory in a single command.

You can also use Command Prompt for other system tasks, such as shutting down or restarting Windows with the shutdown command.

Scroll to Top