Exclude files from layers (Advanced feature)
You can exclude specific files and folders from a composited layer to prevent files from persisting on a user’s desktop. For example, you can exclude antivirus software files and folders that should not persist for a desktop from one login to the next.
The exclusions you define are applied to a composited layer, once that is part of a published image. This feature is not enforced on a packaging machine, only on a published image where the layers have been composited. That means that you define the exclusions while creating the layer, include the layer in the image template, and then publish the image.
Excluded files and folders on elastic layers are not processed. Exclusions can only be processed when present in the image.
Specify files and folders to exclude
C:\Program Files\Unidesk\Uniservice\UserExclusions\ folder, create one or more
.txt files that specify paths to be excluded.
All valid paths to files and directories are excluded and then read from the image. All changes to those files and directories on the writable layer no longer persist.
If one of the files you create contains an invalid path, processing of that file stops and moves to the next
.txt file within the
You can also use a
* character to wildcard one directory for exclusion. For example,
* indicates any user name. In this case, any user name that matches the rest of the path fits the exclusion rule, allowing the administrator to skip the user’s
\Temp directory for all users who use that image.
For each exclusion rule, you can only wildcard one directory (use one
*) in a single path. You cannot exclude multiple directories with one
*. For example, using the rule
C:\Top\*\Bottom\ excludes the files in directories
C:\Top\Second\Bottom\, and so on. But files in the directory
C:\Top\First\Second\Bottom\ are not excluded, because there are two directories between
\Bottom\ rather than one.
There is no limit to the number of exclusion rules you can set containing a wildcard (
Exclude a file:
Exclude a directory:
The following restrictions apply to exclusions.
- Begin the path with C:\
- End with a Backslash (\)
These top-level directories cannot be excluded:
- C:\Program Files\
- C:\Program Files (x86)\
The following characters and expressions are not allowed in exclusions:
- No question marks (?)
- No regular expressions (no %x%)
- No forward slash (/)
- No network (\\)
- No path to a different directory (\..\)
- No quotation marks (“)
- No colon (:) after C:\
Log messages are available in:
C:\Program Files\Unidesk\Uniservice\Log\Log0.txt <!--NeedCopy-->
Messages written to the log:
User exclusion added: Includes the details about the file or directory.
Failed to add user exclusion: Includes details about the unsupported exclusions.