Windows examples of wildcards used in memory protection exclusions

These examples are based on excluding an executable that is stored in this path: C:\Application\TestApp\MyApp\program.exe

Examples

Examples of valid exclusion paths

Relative path without any wildcards to exclude program.exe:

CODE
\Application\TestApp\MyApp\program.exe

Relative path with wildcards to exclude program.exe (or any file):

CODE
\Application\TestApp\MyApp\*

Relative path with wildcards to exclude program.exe (or any file) in the MyApp directory and any of its children :

CODE
\Application\TestApp\MyApp\**\*

Exclude program.exe as long as program.exe is located in the  "MyApp" directory in C:\Application:

CODE
C:\Application\**\MyApp\program.exe

In this example, any directories between the Application folder and the MyApp folder are also excluded.

Exclude any .exe file that is located in the "MyApp" directory in C:\Application :

CODE
C:\Application\**\MyApp\*.exe

Exclude any executable (regardless of its file extension) as long as it is located in the "MyApp" directory in C:\Application :

CODE
C:\Application\**\MyApp\*

Exclude program.exe as long as it is located in any child directory of the C:\Application\TestApp:

CODE
C:\Application\TestApp\**\program.exe

Exclude program.exe as long as it is located in \Application\TestApp\MyApp\ of the C: drive:

CODE
C:\**\Application\TestApp\MyApp\program.exe

Exclude any .exe executable as long as it is located in \Application\TestApp\MyApp\ of the C: drive:

CODE
C:\**\Application\TestApp\MyApp\*.exe

Exclude any executable (regardless of extension) as long as it is located \Application\TestApp\MyApp\ of the C: drive

CODE
C:\**\Application\TestApp\MyApp\*

Incorrect use of asterisks in exclusions

Only use a single asterisk (*) to match characters in a folder name or file name. Double asterisks (**) are reserved to match directory paths or the end of a directory path, and cannot be used at the end of an exclusion.

This is a list of examples in the context of excluding C:\Application\TestApp\MyApp\program.exe.

  • Incorrect: C:\Application\TestApp\MyApp**.exe

    Reason: Double asterisks are reserved for directory paths. Use single asterisks to match characters of a file name.

  • Incorrect: C:\Application**\MyApp\program.exe

    Reason: The double asterisk excludes folders whose names start with Application. Although the syntax is valid, the TestApp directory is not matched in this exclusion.

  • Incorrect: C:\Application\TestApp\*\program.exe

    Reason: Use the double asterisks with file path separators instead of a single asterisk.

  • Correct: C:\Application\TestApp\MyApp\*.exe
  • Correct: C:\Application\**\program.exe

Exclusions that are not recommended

Avoid using a double asterisk (**) immediately after a drive letter. For example:

CODE
C:\**\program.exe

In this example, program.exe is allowed to run from any folder in the C: drive. Although this exclusion is technically correct, it would exclude anything in any directory (including child directories) located on the drive.