How to Open Files and Folders from Command Prompt (CMD)

Learn how to open folders and files from Command Prompt (CMD), navigate directories, and use essential commands to work faster in Windows.

Open a folder from Command Prompt (CMD) in Windows

Knowing how to open files from CMD — including how to open a folder — allows you to work faster, especially when copying files, running scripts, or following technical tutorials. It also gives you access to advanced system functions without constantly relying on File Explorer.

Although Windows’ graphical interface makes many tasks easy, there are situations where working directly from the Command Prompt (CMD) or PowerShell is simply more practical.

How to Open a Folder in CMD

To open or move into a folder using Command Prompt, you use the cd command (short for change directory). This command lets you switch between directories by specifying their path.

Start by opening Command Prompt. You can do this by typing cmd in the Start menu and selecting it from the results.
If you prefer PowerShell, the same commands work in most cases.

Once the command window is open, type cd followed by the full path of the folder you want to access, then press ENTER.

For example, to open a folder named Camino Geek located on the Desktop:

cd "C:\Users\migue\Desktop\Camino Geek"
Open a folder in CMD using the cd command
Example of using the cd command to navigate to a folder from CMD.

If the command runs correctly, the prompt will change, indicating that you are now inside that folder.

Change Directory Using the cd Command

The cd command can be used with both absolute paths (full paths) and relative paths, depending on where you are currently located in the directory structure.

Once you’ve successfully changed directories, you can start working with the files inside that folder directly from CMD.

List Files in a Folder Using the dir Command

After moving into a folder, the next logical step is to check its contents.

To list all files and subfolders in the current directory, use the dir command:

dir
List files and subfolders using the dir command in Command Prompt
File and subfolder listing displayed by the dir command in Command Prompt.

This command displays a list of files and folders, along with details such as dates and sizes, all directly in the Command Prompt window.

How to Open a File from CMD

When you are inside the correct folder, you can open a file simply by typing its full name, including the file extension, and pressing ENTER.

For example:

example-file.txt

Windows will automatically open the file using the default program associated with that file type.

You can also open a file by typing its full path, without first using the cd command. For example:

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

This method is useful when you only need to open a specific file and don’t want to navigate through folders manually.

In addition to opening files, CMD also allows you to delete files, remove folders, or rename items directly from the command line.

Open a Folder in File Explorer from CMD

Working with folders from CMD is powerful, but sometimes you may want to open a directory visually in File Explorer while still starting from the command line.

To do this, you use the start command, which is also documented in the official Microsoft documentation.

To open a specific folder in File Explorer, type start followed by the folder path. If the path contains spaces, you must include an empty title first:

start "" "C:\Users\migue\Desktop\Camino Geek"
Open a folder in File Explorer using the start command
Using the start command to open a folder in File Explorer from CMD.

Press ENTER, and the folder will open in a new File Explorer window.

Open the Current or Parent Folder from CMD

If you want to open the current folder you are working in, run:

start .

To open the parent folder (the folder above the current one), use:

start ..

In both cases, File Explorer will open automatically at the corresponding location.

Create a Folder Using CMD (md or mkdir)

Command Prompt also allows you to create new folders quickly using the md or mkdir command.

To create a folder in the current directory, type:

md newFolder

You can also specify the full path where the folder should be created:

md "C:\Users\migue\Desktop\Camino Geek\newFolder"
Create a new folder from the Command Prompt using the md command
Creating a new folder from Command Prompt using the md or mkdir command.

This is especially useful when organizing files or automating tasks from the command line.

Once the folder is created, you can also protect it or apply additional security settings directly from Windows.

Common Mistakes When Using Paths in CMD

One of the most common issues when working with CMD is forgetting to use quotation marks in paths that contain spaces.

Whenever a folder name includes spaces, the full path must be wrapped in quotes. Otherwise, CMD will interpret each word as a separate argument and the command will fail.

Understanding this small detail can save you a lot of frustration when working with files and directories from the command line.

Final Notes

By mastering these basic Command Prompt commands, you can navigate folders, open files, and manage directories more efficiently without relying on the graphical interface. These skills are especially useful for troubleshooting, scripting, and advanced Windows tasks.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top