What is correct syntax to exclude a folder (and all files and subfolders under)?

I have Nirsoft utilities installed. Like many anti-virus programs, Comodo AntiVirus (CAV) has decided that any user-installed forensic or hacking tools must be bad and will alert on them in scans or upon their execution. So I have to add them to the exclusion list.

When I go to the CAV settings, Exclusions tab, and navigate the displayed tree to select and add a folder to the exclusion list, it adds the following entry:


That doesn’t appear correct syntax. I do not want to exclude any folder there that happens to begin with “nirsoft”. If, for example, there were “nirsoft” and “nirsoftother” then I only want the stuff under “nirsoft” to get excluded and nothing under “nirsoftother” would get ignored. So it seems the correc syntax would be:


That means whenever I select a folder under which everything gets excluded that I have to remember to edit the entry to insert a backslash character before the asterisk.

Looks like you answered your own question.

Yes, if you want to limit the wildcard to only the specific folder, you will need to edit the exclusion to add the "" before the wildcard. I believe the concept is that more often than not, you aren’t going to have multiple folders starting with the same character string in a given directory.

Thanks for replying and verifying my assumption regarding use of wrong syntax for the object that I explicitly selected from the tree list.

I don’t understand the [lack of] logic in an assumption that a folder would be unique in its name from other folders. Users often install in the default folder suggested by the installer program. Well, you could end up with a program that installs under, say “C:\Program Files\co”. This isn’t that far fetched that an overly short folder name gets used. Ghostscript installs in a “gs” folder. That’s just 2 characters. If I wanted to exclude the “co” folder and used the tree and selection mechanism provided by CIS, it would add the following to the exclusion list:

C:\Program Files\co*

Well, that would match on:

C:\Program Files\co
C:\Program Files\Common Files
C:\Program Files\Comodo
C:\Program Files\ComPlus Applications
(et cetera)

So simply slapping the asterisk wildcard onto the selected folder is a very wrong scheme. The object shown in the selection list should match the object selected, not all objects that may match on a substring. The trailing slash should be included after the folder’s name and then followed by the asterisk. As you say, it may have been assumed that the user would not have similar folders that start with the same substring but that depends a lot on just how long is the folder name that got selected. At just 2 characters in length, it isn’t likely that a unique folder name would be specified but at 20 characters then maybe but not absolutely.

The scheme of just appending the asterisk onto the folder name instead of appending the slash and asterisk was a poor design choice.