Excluding Archive and Container Contents from Search Results
WinCatalog looks inside archives (ZIP, RAR, 7-Zip and others) and inside disk images (ISO, VHD, VHDX, VMDK and similar) and stores what it finds there as regular catalog entries. Most of the time this is exactly what you want: you can find a document without remembering which archive it was packed into.
Sometimes it gets in the way. Say your movie collection keeps the same film as Alien.iso, Alien.mkv and Alien.avi on three different disks. A search for “alien” returns the three files you were looking for, plus every .VOB, .IFO and .BUP file stored inside the ISO. The entries you actually need are buried under their own contents.
There is no single switch that turns this off, but the Path row on the Main tab of the additional search options does the job.
The query
Open the additional search options below the search field, go to the Main tab, tick the Path row, switch its Condition to Advanced query, and enter this as the Value:
NOT [.iso\] NOT [.nrg\] NOT [.vhd\] NOT [.vhdx\] NOT [.vmdk\] NOT [.vdi\] NOT [.wim\] NOT [.img\] NOT [.zip\] NOT [.rar\] NOT [.7z\] NOT [.cab\] NOT [.tar\]Then type your search query in the search box and run the search as usual. The container files themselves stay in the results, and everything stored inside them disappears, at any nesting depth. Like every search in WinCatalog, the query is case insensitive.
Copy the query exactly as it is, with the leading dots and the square brackets. Each of those three parts does something, as explained below.
The list covers the container formats WinCatalog opens most often. Add or remove formats to match your collection: the pattern is NOT [. + extension + \] per format, separated by spaces.
How it works
The Path row matches the whole path of an entry, the same value you see in the File Path column, for example D:\Movies\Alien.iso\VIDEO_TS\VTS_01_1.VOB. Files stored inside a container get a path that runs through the container’s own filename, exactly the way it would run through a folder name. That is what makes them possible to filter.
Search terms match at the start of a word. WinCatalog splits text into words at spaces, dots, commas, dashes, underscores, brackets, slashes and backslashes, so in a path both the folder names and the parts of a filename are separate words.
A character that a search term contains stops separating words for that term. This is the rule the whole query is built on. WinCatalog keeps a separate list of word separators for every search term and removes from it every character the term itself contains, so that character can be matched literally instead. The dot and the space are the two exceptions: they always stay separators.
Put together, the term .iso\ means “a word starting right after a dot, spelled iso, immediately followed by a backslash”:
- The backslash is part of the term, so for this term a backslash no longer starts a new word. The term cannot match a folder name that simply follows a backslash; it has to begin at a dot.
- The dot is still a separator, so the term does start at the dot in
Alien.iso. - The trailing backslash then requires something to be stored below that name.
NOT in front of the term removes the matching entries from the results.
| Path | Result | Why |
|---|---|---|
D:\Movies\Alien.iso |
kept | the container itself, nothing is stored below it |
D:\Movies\Alien.iso\VIDEO_TS\VTS_01_1.VOB |
excluded | “.iso” is followed by a backslash |
D:\Backup\photos.zip |
kept | the archive itself |
D:\Backup\photos.zip\2019\img001.jpg |
excluded | stored inside the archive |
D:\Archive.zip\inner.zip\file.txt |
excluded | nesting depth does not matter |
D:\ISO\Alien.mkv |
kept | “ISO” is a folder name, not an extension |
D:\Windows ISO\setup.exe |
kept | the same, the word “ISO” is not preceded by a dot |
D:\Site\img\logo.png |
kept | a folder named “img” is not a disk image |
D:\Downloads\ubuntu.iso.torrent |
kept | “.iso” is not the last extension here |
Why the leading dot
Because it limits the term to real file extensions. Without it, [iso\] still keeps the containers and still drops their contents, but it also matches folder names that merely end with the word “iso”, such as D:\Windows ISO\, D:\Old-ISO\ or D:\Backup_ISO\: the space, the dash and the underscore separate words, so “iso” starts a word there. Extensions like img, zip and tar are common folder names too, which makes the dot worth typing.
Why the trailing backslash
Because it is what separates “inside the container” from “the container itself”. NOT [.iso] without the backslash would throw away Alien.iso along with its contents, which is the opposite of what you want here.
Why the square brackets
Square brackets are the strict match operator: whatever stands between them is taken as one single term and read literally, and the term ends at the closing bracket.
Outside brackets the backslash is the escape character, which is a problem in a query like this one. In NOT .iso\ NOT .vhd\ the first backslash escapes the space that follows it, so the space no longer separates anything and the rest of the line is swallowed into one long term. The search then returns something entirely different, and no error message points at the cause. Inside brackets there is nothing to escape and nothing to swallow.
Things to keep in mind
Names, not file types
The filter reads the path, so it goes by what things are called. A folder that really is named Movie.iso would have its contents hidden as well, and a container renamed to another extension keeps its contents in the results until you add that extension to the list.
Paths are matched by the Path row only
The search box itself matches indexed text: names, comments, tags, ID3 and Exif data, but never paths. Path conditions belong in the Path row and nowhere else.
Also remember that a lone asterisk matches every entry, so a query built around it, such as NOT (*:\* OR *\*\*), means “not everything” and returns an empty result list.
Reports
Reports are built from the search results, so a search filtered this way produces a clean report too. The “archive contents” option of the report settings covers classic archives only (ZIP, RAR, 7-Zip and similar) and has no effect on ISO, VHD or other disk images. The Path filter covers all of them at once.
Save the query
There is no need to retype the query every time. Once the search works the way you want, use Save As… in the drop-down menu of the Search button to store it as a saved search with a name like “Containers only”, together with the search term and every other option you set.
Pair it with other rows of the Main tab when needed. For example, set Type to “Files and other items” to drop folders and disks from the results as well.