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. 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.
Find the file using the Command PromptNow 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.
Documents can't be skipped and jump straight to ExampleWhen you have entered the command, press the key Enter
. You will now be in that 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'
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'
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.
You should read it
- How to use the command history function in Command Prompt
- How to Make Command Prompt Appear at School
- How to open Command Prompt on Windows 10, 8, 7, Vista and XP
- How to Open Folders in CMD
- Add Command Prompt to Power User Menu on Windows 10
- 6 Best Command Prompt Alternatives for Windows
- How to Unblock Command Prompt Anywhere
- Windows prompt
- How to Delete a File Using Command Prompt
- How to Execute a Program in Command Prompt
- How to open Microsoft Excel from Command Prompt
- How to use Xcopy command in Command Prompt