Windows – Command to open windows explorer window with filtered results

command linefile-filterwindowswindows 7

Is there any way to open a windows explorer window with the contents already filtered as if you'd entered them into the search window in the corner?

So I'd like to type directly into the Start Menu or a WinKey+R run menu as shown below then press Enter:

start menu

Ideally I'd get the following result:

example result window

I've tried looking through command line options for explorer.exe but haven't turned up anything to do exactly what I'm asking.

The aim of my question is to figure out if there is an existing command line or something but I'm willing to write an app or script of some sort if there's nothing out there–so any hints as to the APIs I might look at are welcome.

Windows 7 is the minimum platform I'm worried about getting this to work on.

Best Answer

Next to Organize in your screenshot, you can see the Save search button. That will allow you to save the search using your preferred name to:

C:\Users\<username>\Searches\<searchname>.search-ms

If you run this file from the Run dialog or even the command line, Explorer will open up and the search will auto-execute, displaying the results you want. (The search box will not be populated though with the search terms.)

Related Question