Windows 10 (and older Windows version like Windows 7) has always a Command Prompt built-in inside. It’s a tool to do more advanced things, like opening a file. Here’s how to open files in Command Prompt.
Command Prompt doesn’t evolve that much in Windows 10, despite the operating system has developed from the old Windows XP, Windows 7, and Windows 8.1. The opening file method is still the same.
But, why bother searching files and then opening it in Command Prompt on Windows 10? How is it better than doing so in File Explorer?
Well, the answers vary. But one of the most popular reason is that it is a lot faster to search and find stuff in CMD instead of File Explorer, even though it needs more efforts like putting the right command/code.
This is why you need this article. Here’s how to find and open files in Command Prompts.
How to Open Command Prompt in Windows 10, Windows 7, and Windows 8.1
First of all, you clearly need to open the Command Prompt. It’s obvious, I know. But the methods aren’t all the same in Windows 10, Windows 7, and Windows 8.1.
In Windows 10, you can use the search button at Taskbar.
You can also use the Start menu to open up CMD. This can also be done in Windows 8.1 and Windows 7.
Other than that, you can open CMD by opening the Run dialog box (by pressing Windows logo+R simultaneously). Type CMD. Press Enter.
How to Find or Search Files in Command Prompts
You don’t need a complicated code or command to do search files in CMD. In fact, it’s just a line of code:
dir "\search term*" /s
Here’s what it means:
diritself means showing list of directories/folders/files inside the current or any directory.
/smeans including sub-directories to be searched.
*is wildcard. If it’s put at the end of the search term, the search result will show the beginning of your search term. If it’s at the beginning, it shows the end of your search term, eg. searching based on the file format
To start searching, simply change
search term with the term you want to search for.
Once you have written the right command, press Enter. You can then wait for some seconds until the Command Prompt shows a result.
In this example, I see “Volume in drive C has no label.” and other lines following it. At the bottom, you will see the search result of what you’re looking for.
Now that you know the directory of the file you searched, you can now open the file in Command Prompt.
How to Open Files in Command Prompt
Opening files in CMD is easy. It just needs this code to make it work:
It needs to follow the directory you want to open the file from. The code can’t directly open the file. That’s why you have to press Enter after navigating to the directory.
Once you’ve navigated to the folder, now just type the filename followed by the file format. Press Enter.
The Command Prompt will instantly open the file.
Is there any other way to open files in Command Prompt without having to navigate the folder first? Yes, there is.
You can use
cd to navigate to the root directory or partition. Then, use
" at the beginning and at the end to open the file directly in Command Prompt.
Command Prompt is an easy-to-use tool, which can also be used to open files, quicker than using File Explorer. You can find and open files in CMD using the above methods, and you can also do other stuff like deleting files.
RELATED POST: How to Install Java Development Toolkit in Windows 10