Find and Open Files using Windows Command Prompt

Finding and opening the files through windows explorer is simple but it takes some time. There is a faster way to achieve the same using command prompt. Working through command prompt is the quickest way to get things done. Through command prompt, you can find things quickly and allows you to open the files right there.

Search a file in Windows Terminal

Type cmd in the search bar of your Windows 10 computer. From the results, click on command prompt to open it. Type the following line in command prompt window:

dir "\search term*" /s

Replace the search term with the file name that you want to search.

I will describe a little what the terms in the command actually means.

  • Dir - It is used to list the list of files and subfolders contained in a folder.
  • \ - It is used to tell dir to search from the root directory of the current drive.
  • * - It’s a wildcard character. if used before a name (e.g *data), will search for text that ends with that specific name data. If used after a name(e.g data*), will search the text starting with the name data.
  • /s - It is used to tell dir to search from all sub-directories

For instance to search a file name “data set”, I will enter”

dir "\screenshot3*" /s

Search for a file using Windows Terminal

It will list file name starting with name screenshot3 along with its directory.

Open a file from Windows Terminal

After you find the file you want to open, you can launch it without navigating through windows file explorer.

In a command prompt window, type cd followed by the path of the file that you wish to open. After the path matches with the one in the search result. Enter the file name of the file and press Enter. It will launch the file instantly.

Using Windows Command prompt to open a file

By following the above method, you can easily search and open a file using command prompt as it is a quick way of accessing any file as compared to windows file explorer.

1 thought on “Find and Open Files using Windows Command Prompt”

  1. Avatar

    Thanks! God Bless You!


Leave a Comment