43

While searching for Windows.h, I discovered some rather annoying search behaviour on Windows 10. Rather than being presented with a single result of Windows.h, I was presented with an entire laundry list of files with "Windows" in them and "h" in them, which is not what I wanted. Searching for "Windows.h" did not help.

How can I search for Windows.h and receive only files with exactly that name?

enter image description here

2
  • Have you considered that your doesn't have a file named Windows.h that's typically only on a pc with the appropriate SDK installed
    – Ramhound
    Jan 2 '17 at 0:01
  • 6
    I have attached a picture that shows that Windows.h is present, but I do not want to see all of the other results.
    – xaav
    Jan 2 '17 at 0:18
61

If you want to match only filenames and not file contents, you can qualify the search with name: like:

name:Windows.h

If you want an exact filename match, you can qualify the search with name:= like:

name:=Windows.h
3
  • 6
    Note that the term name is translated to the system language. You can figure out your language's term by changing the view to "detailed list", and check the name of the column for file name. Example in Swedish, it says "Namn", so you type namn:=.
    – Liggliluff
    Jun 14 '19 at 9:42
  • 6
    This works with other explorer items as well, I just found I could use extension:=.h to find all .h files regardless of name.
    – PeterJ
    Nov 8 '19 at 5:12
  • 2
    Is this documented within Windows?
    – Charlweed
    Jan 13 at 1:58
7

If you need to search for specific files, which includes special characters, such as (, ), spaces and numbers in between, then you'll need to tilde + quote it.

For example, this is a wildcard search for all duplicated filenames, with any extension, that Windows has added (0-9) before the dot:

~"* (?).*"

enter image description here

Note that ? will catch any single character, not just a digit, so above example will also find files/directories that have a space + any single character between parentheses + dot. For example: My Directory (A). with a dot.

1

I found quotes are necessary to do this.

name:"Windows.h"

If this does not work, one may try:

name:"Windows" ext:"h"

This syntax seems, to me, to have changed recently, either with Explorer or Office applications, and so searching the internet for this has been cumbersome, speaking for myself. Thanks for your inputs.

Using Windows 10 (10.0.17134 Build 17134)

Thanks to u/hudson4351, Reddit. https://www.reddit.com/r/Windows10/comments/g9s2uk/how_to_search_for_exact_match_in_file_contents/ https://www.reddit.com/user/hudson4351/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.