1

I am trying to find any files or folders that match some name. This and only this. The problem is that in my search results I am also getting any file or folder that has the search text as part of its location.

For example, when I search "Program Files" for "Temp", the result is thousands of thousands of files that have "Temp" as part of their location.

How do I do a search where the result is just the files and folders named "Temp" (or, for example, "Template") themselves and not their path or contents?

screenshot showing search results for "Temp" (many files, not named "Temp")

birgersp
  • 143
  • 10
  • 1
    You have to specify to search in the file-name. Search for `name:temp` – Robert Mar 01 '21 at 10:49
  • 2
    Does this answer your question? [Windows Search for exact filename and extension only](https://superuser.com/questions/1162403/windows-search-for-exact-filename-and-extension-only) – harrymc Mar 01 '21 at 10:52
  • Not really. His screenshot shows a solution but the questions are different. I am not necessarily looking for only files/folders named exactly "Temp". E.g. folders named "Template" should also show... – birgersp Mar 01 '21 at 11:26

3 Answers3

1

Got the answer from a comment by Robert.

Use name:Temp rather than just Temp.

birgersp
  • 143
  • 10
0

You can search for what you want just entering double quotes, for example (as you need):

"Temp"
Bellisario
  • 11
  • 2
  • Adding double quotes did not solve the issue. "Irrelevant" files/folders are still shown. – birgersp Mar 01 '21 at 11:22
  • You can also add .extension to "remove" some files and also add * to search for a file that you don't know completely. – Bellisario Mar 01 '21 at 12:14
0
  • name:temp will find files called “temp” or “template”, but not “attempt”, “badtempered”, “contemplate” or “distemper”.  To get those, try filename:*temp.  It seems that name and filename sometimes get different results, at least on some versions of Windows.
  • While searching with name or filename will not match files simply because they are in a folder whose name contains “temp”, it will still find those folders themselves.  To get just the files, use
    filename:*temp -type:folder
    
    where the - (minus sign, also known as hyphen) means “NOT” (i.e., subtract those results).
  • Some people will tell you to use kind:folder instead of type:folder.  Warning: type:folder means actual folders, while kind:folder means actual folders and also files like .zip files.  If you have a file called “template.zip”, then filename:*temp -type:folder will find it, but filename:*temp -kind:folder will not.