Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 stackoverflow.com May 23 '13 at 16:33

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

3 Answers 3

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
1  
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
1  
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

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 at 16:59

-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

Your Answer

 
discard

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