How do exclude folders from windows search

I am wanting to exclude specific folders from windows search.

* Please try a lower page number.

* Please enter only numbers.

* Please try a lower page number.

* Please enter only numbers.

To exclude a specific folder’s contents, along with subfolders and their contents, the path to that folder can be specified with a minus sign as in this example syntax:

-folder:(C:\Users\Administrator\Desktop\chart graphing)

If you know that the folder has a unique name within the full area that you are searching, then you can leave off most of the path, as in:

-folder:(chart graphing)

If you instead want to permit searching inside of subfolders of such a folder, while still excluding files that are immediately inside of that folder, then use:

-foldername:(chart graphing)

You can use multiple instances of the syntax to exclude more than one folder.

A related task that is worth mentioning here:

If Folder Options is set for searching to include subfolders, then to limit the search results to items within a currently windowed folder named wert and not the subfolders of wert, enter folder:"\wert" with other desired search parameters into the search box of the wert window.  The quotation marks and backslash are required to have the desired effect.  If a minus sign or NOT preceeds folder:"\wert", then the results are limited to items within the subfolders of wert and not immediately in wert itself.  Be aware however, that if a subfolder of wert happens to also be named wert, then that subfolder will also be involved.  The remedy is to use the complete path and the symbol for "match exactly", as in folder:="C:\this\that\wert", and that will avoid involving the folder at C:\this\that\wert\others\wert.

97 people found this reply helpful

·

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Just to make sure I understand correctly, I would have to use these commands every time I search. If so, that would not work.

Basically what I have set up is a (very large and structured) group of documents that has a sort of manual version history. (Once a file has been replaced it is moved to a "old versions" folder.  When I use the widows search to find the current version, it also searches "old versions" folder. I would like to prevent it from searching the "old versions" folders.

Appreciate it. 

Also, is it possible to have windows automatically use the "-foldername:(oldversions)" every time I search? That would probably work.

10 people found this reply helpful

·

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

That's right, if you are searching a wide area including non-indexed folders, then you would have to use those commands.  Alternatively you'd place your old versions folders outside of the area that you search, assuming that you are not searching your entire hard drive necessarily.  (You'd be navigating to a folder on your hard drive that would contain everything that you might search, and use that folder's search box in the upper right corner, instead of using the Start menu search box.)

 

Otherwise, you could have the indexing settings be set for which areas to index and which to not index, and only search within indexed areas or the Start menu search box, but then you would be limiting yourself to indexed areas.  (See Indexing Options, which you can find with the Start menu search box.)  Indexing is not usually done to entire hard drives, with all of those system files and whatnot.

 

As for automatically searching as with "-foldername:(oldversions)" regardless of indexing settings, if that can be done at all it would be by some method more complicated than I know about.

5 people found this reply helpful

·

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

As for automatically searching as with "-foldername:(oldversions)" regardless of indexing settings, if that can be done at all it would be by some method more complicated than I know about.

I think this would be the optimal solution. Hopefully someone can help on this.

6 people found this reply helpful

·

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

To exclude a specific folder’s contents, along with subfolders and their contents, the path to that folder can be specified with a minus sign as in this example syntax:

-folder:(C:\Users\Administrator\Desktop\chart graphing)

If you know that the folder has a unique name within the full area that you are searching, then you can leave off most of the path, as in:

-folder:(chart graphing)

If you instead want to permit searching inside of subfolders of such a folder, while still excluding files that are immediately inside of that folder, then use:

-foldername:(chart graphing)

You can use multiple instances of the syntax to exclude more than one folder.

 

A related task that is worth mentioning here:

If Folder Options is set for searching to include subfolders, then to limit the search results to items within a currently windowed folder named wert and not the subfolders of wert, enter folder:"\wert" with other desired search parameters into the search box of the wert window.  The quotation marks and backslash are required to have the desired effect.  If a minus sign or NOT preceeds folder:"\wert", then the results are limited to items within the subfolders of wert and not immediately in wert itself.


Thanks for sharing such important info, a problem though, i couldn't make it work. For instance, i am trying to find a .psd file that i happen to not know the name, as i have a stupidly large collection of images i am pretty sure the file is there, but my collection is organized in folders, and i want to exclude the folder SSs

so what i am typing is this: ".psd" -folder:(SSs)
i have also tried the inverse: -folder:(SSs) ".psd"

but then i get instant zero results... am i doing it wrong orrr?

Thanks

1 person found this reply helpful

·

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

It should work (though I'll mention that Windows 7 Search can't be made case sensitive, so it doesn't matter whether you put SSs or sss).  Just to verify:  are you searching from the Start menu, or within a library, or in a window for the whole hard drive?  I would navigate to the hard drive and search using the box in the upper right corner of its window, so as to avoid anything to do with indexing as a factor (Start menu and libary searching are limited to indexed items).  Another possibility is that the string sss also appears in a name in desired folders' paths and not just the name of the folder that you want excluded, so you could try -foldername:=sss to ensure more specificity.  The equals sign would exluded items in a folder exactly named sss (regardless of upper or lower case) but allow items in folders named sss with other strings as part of the name.

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Hi

You can try -folder:(SSs)+*.psd   . Hope it works. Worked for  me.

2 people found this reply helpful

·

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

3 years after - one tricky question from me: Is there any way to exclude all folder names from the search result? Any way that search to return only file names?

In the concrete example - I'm modding unpacked games. I often finish with searching in million files for specific one(s), yet the search always returns several thousand folder names together with the searched file(s). This leads to results number above 5000; and this from its side makes the search very slow and very hard to sort the results.

1 person found this reply helpful

·

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Sure, you can specify the type as file folder and put a minus sign on that as part of your search.

-type:"file folder"

9 people found this reply helpful

·

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Perfect. That was great help. Thank You

1 person found this reply helpful

·

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

* Please try a lower page number.

* Please enter only numbers.

* Please try a lower page number.

* Please enter only numbers.

 
 

Question Info


Last updated May 4, 2024 Views 94,801 Applies to: