How to find and open files with Command Prompt

Once you've learned how to navigate folders on Windows 10, the next step is to learn how to find and open files with Command Prompt. This is as easy as navigating and opening a file in File Explorer.

Once you've learned how to navigate folders on Windows 10, the next step is to learn how to find and open files with Command Prompt. This is as easy as navigating and opening a file in File Explorer. Here is how to do this.

First, open Command Prompt on the PC by typing cmd in the Windows search bar and then selecting Command Prompt from the search results.

Once the Command Prompt is open, you're ready to find and open your file.

Find the file using the Command Prompt

Perhaps you already know the file path to the item you want to open or not. If not, you don't need to search through File Explorer and return to the Command Prompt later. You can use this command instead:

dir "search term*" /s

Of course, just replace the 'search term' with the actual search term . So, if you want to locate the file named Example File , then you need to use this command:

dir "example file*" /s

The Command Prompt will now search and display all instances of the search term you have entered. It will show you the file path and provide you with the name and file extension.

Picture 1 of How to find and open files with Command Prompt
Find the file using the Command Prompt

Now that you have found the file, open it.

Open the file using the Command Prompt

To open the file, you need to navigate to the folder in the Command Prompt that contains the file you want to open. In this example, the article has created an Example folder in Documents , so we'll go there.

In the Command Prompt, use the Change Directories ( cd ) command to navigate through the directories. Because we are currently at the top level of the file system on a computer, we will need to go to Documents first and then Example . So this command will be used:

cd DocumentsExample

Note that you must navigate to the file structure immediately. In this case, you can't skip Documents and jump straight into Example.

Picture 2 of How to find and open files with Command Prompt
Documents can't be skipped and jump straight to Example

When you have entered the command, press the key Enter. You will now be in that directory.

Picture 3 of How to find and open files with Command Prompt
You are in the Example directory

Now it's time to open the file in that directory. The file opened in this example is the Example File .

To open a file, enter the file name and extension in quotation marks as follows:

'example file.docx'
Picture 4 of How to find and open files with Command Prompt
Enter the file name and extension in quotation marks

The file will open.

To make things a little faster, you can navigate to the correct directory and open the file with a single command. Assuming you have returned to the top level of the file system, run this command:

'DocumentsExampleexample file.docx'
Picture 5 of How to find and open files with Command Prompt
Can navigate to the correct directory and open the file with a single command

The only difference is that you don't have to add the cd command and the entire path in quotes.

Update 13 June 2020
Category

System

Mac OS X

Hardware

Game

Tech info

Technology

Science

Life

Application

Electric

Program

Mobile