Page tree
Skip to end of metadata
Go to start of metadata

Excluding files from Images

We've created a new Macrium VSS writer that enables exclusion of unwanted files from VSS Snapshots. Using this filter, you can exclude various standard file categories, specific files, or apply wildcard filters recursively to selected folders. 

Take the 'Other Tasks' > 'Edit Defaults and Settings...' menu option, select 'Backup Defaults', then click 'Exclude Files'

Exclude files matching the criteria belowEnables/Disables all file filtering
Downloads folderFiles downloaded from the Internet, such as those obtained via web browsers
Temp foldersTemp folders are used to store short-term files created by the operating system and applications
Temporary Internet filesThese are cached files used to speed up web browsing
Windows software distribution filesDownloaded updates from Microsoft
Recycle binFiles you have deleted and can potentially recover. Note: Excluding the Recycle Bin will prevent recovery of deleted files after a restore, so use this option with caution
Advanced Exclusions buttonOpens the Advanced Exclusions dialog for more granular control over file exclusions

Advanced Exclusions dialog

Add File...Opens a browse dialog to select a single file for exclusion
Add Wildcard..Opens the 'Wildcard dialog'
RemoveRemoves the selected filter from the filter list


Wildcard dialog


Select Folder...Opens a folder browse dialog to select the folder to apply the filter
WildcardEnter a wildcard filter. E.g. in the form of  *. * or *.temp
Include subfoldersSelect to also recursively exclude files that match the wildcard filter in subfolders


Alternative method using the Microsoft VSS Optimization Writer

Note: The Microsoft VSS Optimization Writer can be unreliable and we recommend using the built-in functionality in Macrium Reflect


Microsoft VSS
includes the ability to exclude file patterns from snapshots. Although this can be useful in removing unnecessary files from images and clones the functionality isn't 100% reliable.  Removing files is reliant on the VSS Optimization Writer and the if the files are not removed before the VSS timeout time has elapsed then snapshots may not exclude all the desired files. However, In general, unless you are removing many thousands of files then there shouldn't be a problem.


If necessary, create the following registry key:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\BackupRestore\FilesNotToSnapshotMacriumImage

This key should already be present if a Macrium Image has previously been run on the PC. 


If the key already exists then there should be one entry for this key:

Name:RestorePoints
Type:REG_MULTI_SZ
Value:

$AllVolumes$\System Volume Information\*{3808876B-C176-4e48-B7AE-04046E6CC752} /s

This entry is essential and ensures that the shadow copy diff area is excluded from images. Without this entry images may become unnecessarily large. Don't worry if the entry isn't there, it will be automatically created when the next image is run. 


Add new entries(s) for your own exclusions. For example to remove the temp folders you could create one entry as follows:

Name:TempFolders (This can be any name you wish)
Type:REG_MULTI_SZ
Value:

C:\Windows\Temp\*.* /s
C:\Users\\UserName\AppData\Local\Temp\*.* /s


Note: The type of registry must be Multi-String. You can create as many or as few string values for each registry entry as you wish, but you must press enter at the end of the last string to end the list. In the above example there are 3 lines

The '/s' text at the end of the path tells VSS to all enumerate all sub folders. 



You can also use the variable $UserProfile$ instead of the absolute path. e.g, $UserProfile$\Appdata\Local\Temp\*.*  to exclude temp folder files for all user profiles. 



More information on the formatting available can be found here:  https://msdn.microsoft.com/en-us/library/windows/desktop/aa819132(v=vs.85).aspx

Please note that you must use the registry key: FilesNotToSnapShotMacriumImage when following the above MS article.

  • No labels