How to search any file through Command Prompt in Windows 10 / 11

Windows 10 and windows 11 search box is a very efficient tool to search for a file or folder. But it is troublesome when you are performing a search over a variety of parameters. Not only it doesn’t entertain a huge no a file at a time, but the search process is also very slow. If you want to find specifically something on your computer, you can do it easily from Command Prompt.

Method-1 Use dir command

1. You can easily launch the Run by pressing Windows key+R.

2. Then, type “cmd” and click “OK“.




Command Prompt window will be open.

3. First, you have to go to the hard disk drive where the file is on your computer.

4. Enter the name of the drive where you want to search in CMD and then hit Enter.

drive letter:




5. Now, copypaste this command in Command Prompt window, modify it according to your need. Then, hit Enter key from your keyboard to execute it.

dir /s *file/ folder name or keyword in the file name*


Enter the name or part of the name of the file/ folder in the command between the * signs. Example– We wanted to find the “GTAV” file. So, the command should look like this-

dir /s *GTAV*



Dir S Gtav


You will notice the file (or files) in the command prompt with elaborate explanations about its location, size, modification date.


Method-2 Using Where command

Copying the search results in the Notepad is an easier way to use the information elsewhere. To do this follow these steps-

1. At first, click on the search box beside the Windows icon and type “cmd“.

2. Then, right-click on “Command Prompt” in the elevated search result and click on “Run as administrator“.


Cmd Search


3. In Command Prompt window, copy-paste and modify the command. Then, hit the Enter key to execute it.

where /r <file/ folder location> *file/ folder name*


Gta V Method 2



Enter the name of the file/ folder in the command between the * signs with the file/ folder location

. Example– We wanted to find “GTAV.exe” at ‘e:\GTAV‘ folder location. So, the command, at our end, looks like this-

where /r e:\GTAV *GTAV.exe*

4. Now, if you want to see the results in the Notepad window, copy-paste this command and modify it. Then, hit the Enter key to execute the search process.

where /r <file/ folder location> *<file/ folder name>* |clip


Clip Comadn


After executing this command you won’t notice any results, as the results are already copied.

5. Click on the Search box beside the Windows icon and type “Notepad“.

6. Click on “Notepad“.


Notepad Search


7. In the Notepad window, right-click on a space and then click on “Paste“.


Paste It


You will see the search results in the Notepad window.


Notepad Save


This way you can search any file/ folder by passing a single command in Command Prompt.

Additional Tip

You can perform an indefinite search (where the full name of the parameter is unknown). In that, case the command will be-

dir /s < portion of the file name*>


Pic 1


This search will list out all the names of such files that have the same letters as you have asked in the command.

Like if you want to list out file names starting with “pic” so the command will look like this-

dir /s pic* 

In the search results, you will see only the files that have a name starting with “pic“.


Pic Search


2 thoughts on “How to search any file through Command Prompt in Windows 10 / 11”

  1. On the file explorer
    *.jpg size:medium datecreated:1/1/2021..1/31/2022 datemodified:1/1/2021..1/31/2022

    Looking for all jpgs on drive c *.jpg

    (size created by camera) size:medium

    Either the date created or the date modified
    datecreated:1/1/2021..1/31/2022 datemodified:1/1/2021..1/31/2022

    The goal is to find files created in each month of multiple years
    Copy them and paste them in a subdirectory on an external hard drive

    Can this be done in the command mode

Comments are closed.