Microsoft Windows Logo

Once you've learned how to navigate directories on Windows x, the next stride is learning how to find and open files using the Command Prompt. It'due south merely as easy every bit navigating through and opening a file in File Explorer. Here's how it'due south washed.

First, open the Control Prompt on your PC by typing "cmd" in the Windows Search bar and so selecting "Command Prompt" from the search results.

Command prompt app in windows search

With the Command Prompt opened, you're gear up to find and open your file.

Detect Files Using Command Prompt

Maybe y'all already know the file path to the item you lot want to open up–maybe not. If non, y'all don't need to search through File Explorer but to come back to the Control Prompt later. You can use this command instead:

dir "\search term*" /s

Just supersede "search term" with, of course, the actual search term. So, if we wanted to locate our file called "Example File," nosotros'd use this command:

dir "\case file*" /s

Command Prompt volition now search and find all instances of the search term you entered. It will (1) testify you the file path, and (2) give you the file proper name and extension.

Find a file in the folder with dir command

Now that we've constitute our file, permit's open information technology.

RELATED: How to Use File Explorer Without a Mouse on Windows ten

Open Files Using Command Prompt

To open up the file, you need to navigate to the directory in the Command Prompt that contains the file you would like to open. In this example, we've created an "Example" folder in our "Documents" folder, and so we'll head there.

In Command Prompt, use the Modify Directories command ( cd <binder> ) to navigate through your folders. Considering we're currently at the top level of the estimator's file organization, we'll need to go to "Documents" first and then "Example." So, we'll use this control:

cd Documents\Example

Note that you must navigate to the immediate file structure. In this case, we can't skip "Documents" and bound straight to "Example."

Use the cd command to navigate folders

Once you have inputted your command, press the Enter key. You'll at present be in that binder.

Command Prompt showing the user which folder they are currently in

Information technology's now fourth dimension to open the file within that folder. Our file is named "Example File."

To open the file, enter the file name and extension in quotations. In this instance:

"example file.docx"

enter file name and extension in command prompt to open file

The file will now open.

To brand things a bit quicker, you lot tin can actually navigate to the correct folder and open up the file in a unmarried command. Assuming we are dorsum at the peak level, we would run this command:

"Documents\Example\case file.docx"

Enter file open command in one command

The but difference is you don't add together the cd command and the entire path is in quotations.


The above article may comprise affiliate links, which aid back up How-To Geek.