Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

The Windows 7 search drop down always searches within sub folders - I only want to search the current folder. Does not seem to be a way to do this. Help.

share|improve this question

migrated from May 23 '13 at 16:33

This question came from our site for professional and enthusiast programmers.

A way to do this (in Windows 7) is to discard all subfolders using -folder: with \*, for example:

*.zip -folder:"Downloads\*"

That's all.

share|improve this answer
Or to generalize to any current directory: *.zip -folder:".\*" – protongun Dec 29 '14 at 23:41
NVM, the above doesn't work as expected. Perhaps someone can offer a correction? – protongun Dec 29 '14 at 23:47
*.zip -folder:".\*" also excludes the current directly (as well as sub-directories). The above example works correctly to only exclude all sub-directories if "Downloads" is the current working directly. – ashtonium Feb 4 '15 at 16:59

In order to not search in sub-folders, in the search window, click "organize" (upper left corner) and select the option "Folder and search options." In that window, select the "Search" tab. Unselect the the option "Include subfolders in search results..." That will do the trick!

share|improve this answer
That will NOT do the trick. And that is a rotten glaring DANGEROUS bug in Explorer. Think Search -> Ctrl-A -> Delete. Subfolders are ALWAYS searched from the Explorer search box. – user350381 Jul 26 '14 at 23:08
Nick is most definitely wrong. In Windows 7 this works. – Roald van Doorn Aug 1 '14 at 11:26
This is a permanent change for a casual/ephemeral search, it doesn't make any sense to do this. – Ivan Castellanos Dec 16 '14 at 9:02

-folder:(name_of_subfolder) will exclude "name_of_subfolder" from the search results.

On the Microsoft website, see Advanced Query Syntax for more options (some of which may be outdated), and Advanced tips for searching in Windows which uses a newer syntax such as System.Kind:<>picture, but seems to be less complete.

share|improve this answer
This sort of parameter is exactly what I was looking for! – NiteCyper Nov 17 '14 at 13:11
@NiteCyper, did it work for you in Windows 7? (I am not on Windows, but it seems the parameter is outdated? See the links I added to the answer.) – Arjan Dec 14 '14 at 9:43
For future readers: it seems that System.FileName can also match directory names, so then maybe System.FileName<>name_of_subfolder would work. Also, System.Kind might allow for System.Kind:<>folder to exclude all folders (or when combined with System.FileName specific folders?). And it seems one might use this long list in search. (But: I am not using Windows.) – Arjan Dec 14 '14 at 9:51
@Arjan Yes, I use Windows 7. Windows 7 seems to have automatically removed the colon. – NiteCyper Dec 16 '14 at 0:18

*.zip folder:"\MyFolder"

This must be run from the parent folder to search MyFolder, but none of MyFolder's sub-folders or sibling folders. The double quotes and the leading backslash appear to be required. I tested this on Windows 7 and it worked. I found this answer here: how do I NOT search subdirectories

While I found the excluding folder option from another answer worked (thanks), if you have a lot of subfolders to exclude, this option is likely easier.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.