Search syntax for "folders containing specific file types" ??


  1. Posts : 89
    Windows 10 Home 64bit
       #1

    Search syntax for "folders containing specific file types" ??


    Does anyone know if there is a syntax for finding all folders containing certain types of files? Like if I wanted to find every folder on my D drive containing photos (and have just the folders listed in the search results.) Or find every folder containing ebooks, whatever. How would I do this?

    Thanks!
      My Computer


  2. Posts : 817
    Windows 10 Professional x64 21H2
       #2

    Here you go. I assume your speaking of searching File Explorer. Search in File Explorer in Windows 10
      My Computers


  3. Posts : 89
    Windows 10 Home 64bit
    Thread Starter
       #3

    Lance1 said:
    Here you go. I assume your speaking of searching File Explorer. Search in File Explorer in Windows 10
    Thanks Lance. Most of that I know already. I was asking for syntax to specifically find folders containing a certain file type i.e. photos.

    For instance a search string that would in effect request: "List all folders on drive D containing photos" or "List all folders on drive D containing videos" and have just the folders containing those files, not the files themselves, listed in the results.
      My Computer


  4. Posts : 959
    Microsoft Windows 10 Home
       #4

    The closest you'll get in Explorer (AFAIK) would be to:
    1. Search for desired file type (kind:=picture)
    2. Add Folder Path column to Search Results
    3. Group results on Folder Path
    4. Collapse all groups

    Search syntax for "folders containing specific file types" ??-screenshot-801-.png

    In PowerShell, you could use:

    Code:
    $Base = 'D\*'
    $EXt = @( '.jpg', '.png' )
    $Ext.ForEach({ $Base + $_ }) | gci -file -recurse | select DIrectoryName -unique
      My Computer


  5. Posts : 89
    Windows 10 Home 64bit
    Thread Starter
       #5

    Hey—that's actually pretty good Keith! Just tried it and the list of folders that I get when collapsing the headers is exactly what I was looking for. Plus, if I right-click a group header it gives me the option to open that folder. Perfect.

    Thanks so much!
      My Computer


  6. Posts : 959
    Microsoft Windows 10 Home
       #6

    pjfarr said:
    Hey—that's actually pretty good Keith! Just tried it and the list of folders that I get when collapsing the headers is exactly what I was looking for. Plus, if I right-click a group header it gives me the option to open that folder. Perfect.

    Thanks so much!
    You're welcome! Glad that works for you.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 10:36.
Find Us




Windows 10 Forums