All of us have been in situations where we store files on the computer, however, totally forget the file location. Surprisingly, many times we forget the file name and still give our best to look for the same file without failing. Imagine how many times your seconds are converted into minutes & then minutes into hours for finding files.
From using the Ctrl + F function on My Computer to looking drive separately, every possible way had been checked but no luck. Did you think about using the Command Prompt feature to search & open a file? Do you know we can easily look & open a file in cmd on Windows 10 PC? From opening up folders in Command Prompt to launching files, everything is possible.
Also Read: Customize Command Prompt in Windows 10
Search & Open Files in Command Prompt on Windows 10 PC
Many of us know that Command Prompt offers many features that aren’t possible with traditional PC use. Having said that, Windows Explorer on your system is a powerful tool to find files on the system. However, Command Prompt can come really handy when you have either forgotten the file name completely or the file location. This is when you switch to Command Prompt to look & open folder in cmd in easily:
A. Finding Files or Folders With Command Prompt
- Start with searching for cmd (Command Prompt) in your Windows Search option & tap on “Run as administrator”
- Once launched successfully, type in “
dir "\*file name*" /s” to look for the targeted file. Please know that in the above code, you need to replace the file name with the actual file’s name you have been trying to find.
- There are high chances that you might find multiple file results (even though there is only 1 file with that particular name on your system).
- Now you might think that finding out your file would be hell of a task but it wouldn’t be (you’d know your file’s actual size so it will be narrowed down easily).
- Please know that for now, Command Prompt is searching for your file in Drive C only. However, in case you have multiple drives, you need to search those files in that drive as well. In order to do so, before typing in the above code, type D:\ (In case you have D drive).
- Once you are into Drive D, you can use the same command “
dir "\*file name*" /s” to look for the file here as well. Accordingly, if you have more than 2 drives & aren’t able to find the file in the first 2, look into other drives as well (using the same process).
B. Opening Files or Folders With Command Prompt
In order to open a file or folder on Windows 10 PC, first you need to know the actual location of the file. And thanks to Command Prompt’s advancement, you can open a file in cmd seamlessly. Now there are multiple ways to open a file in command prompt on Windows 10 PC, however, we will be discussing the most reliable & popular ones as mentioned below:
1. Open A File in Command Prompt Via Folder Route
You need to start with narrowing down the file’s folder that you wish to get access to. So if your file does belong to a folder called “Demo” in Drive D, you have to get into Drive D.
- To do so, just like we did in the above section, get yourself entered in Drive D, however, if your file’s folder is in Drive C, you don’t need to enter in that one as its default logged in.
- Considering your file’s folder is in Drive D, now you need to type in the command, “cd demo folder/”.
- After getting into the folder, type in the file’s name (for example “demo2.jpg”) and hit ENTER.
- Doing so will open up the file for you in Windows 10 PC with the app that’s been default set for file type. Simple!!
2. Open A File in Command Prompt Directly
Apart from trying to open a file in cmd through the folder route, you can directly open files as well. In order to do so, the only prerequisite is that you must know the exact file path on your system. Now that you are aware of the file path, let’s start getting the way to open a file in cmd:
- For example, if you are trying to open a file that’s stored in drive D in the February folder, you need to give it the exact right path. So the path we will be trying to open is “
D:\Stuff\Img\Feb 2021\13 Fed\CMD\demo1.jpg“.
- So as soon as you hit ENTER on the above mentioned path, the file will get launched on your system.
So now you can see that the whole process of searching & opening a folder or file in cmd on Windows 10 PC is pretty easy to implement.
Command Prompt is one of the most powerful tools one can access in Windows PC, however, we have faced different challenges. One of those challenges is being unable to find a file which you don’t remember the path of. Or sometimes you want to find & open a file in cmd, but aren’t able to do so. This is where you can start using the Command Prompt & open files in cmd seamlessly. So without further ado, start exploring the command prompt & look for files when you are confused with the file path or location.