Home » Blog
date 14.Mar.2021

■ How to exclude some folders from a search scope

Usually when you search for files, you start from a top folder (the search root) and scan all its subfolders. What if you don't want to search all the subfolders though, how do you tell xplorer² to exclude a few? For example many times I search the source code repository for some keyword, but I don't want to look into all these Tortoise .SVN source control folders. Excluding unnecessary folders will make the content search much faster. There are many ways to exclude folders.

Searching among less files is important if you have the slow(er) professional edition, or when searching for source code symbols that aren't available through windows search index — which only stores text

Method #1: exclusion filter in Look In
Look In field in find files or folders dialog shows the root search folder, which you were browsing when you pressed <CTRL+F> to start the search. You can add a negative (exclusion) wildcard after the folder name, separated by comma and starting with a minus sign. For example to exclude .SVN folders add after the search root path:

E:\Users\god\mine\source , -*\.svn\*

Any valid wildcard (even partial) can be used to match and filter out folder paths. This method is the best as it will exclude all contents of matching subfolders, they won't even be enumerated.

exclude path

Method #2: exclude using Path rule
Add a search rule on Path column, where you match (part of) the path you want excluded. The rule must be added as negative (boolean not) to filter out any matching files. This technique will also do the job, but it is rather wasteful, as all .SVN subfolders (and their subfolders all the way down) will be enumerated, and all contained files excluded one by one. The advantage is that you can save the exclusion as a filter to be reused in other searches.

Notice you don't need wildcards in the rule definition, as all text rules implicitly assume them; either .SVN or *.SVN* work the same

exclude files by path

Method #3: exploit hidden attribute
Tortoise SVN folders are marked hidden (H file attribute), so if you turn off "show hidden files" option xplorer² won't search in them at all. This method is also very efficient but can only be used to skip hidden folders. You can toggle "show hidden files" either using program options or double-clicking on the hidden files status bar panel (the last but one), as seen below:

toggle hidden files and folders

There is yet another method to skip folders from search scope, using the blacklist. If there are any folders you never want to search in, then add them in the blacklist using Advanced options (either by full path or by wildcard). This solution is permanent but rather inflexible.

Post a comment on this topic »

Share |

©2002-2021 ZABKAT LTD, all rights reserved | Privacy policy | Sitemap