Windows 7 USMT – Exclude Files

The User State Migration Tool can be customised to either include or exclude files or folders being transferred to the new installation of Windows 7.

To change the options you will need to have a basic understanding of XML coding.

To modify the configuration, navigate to your USMT configuration files, right click on ‘Custom.xml’ and select ‘Edit’

Example Configuration Changes: Exclude Files

The following component can be added to exclude the ‘TESTFILE.exe’ file and all Citrix PNAgent files from being transferred to the new installation.

<!-- This component excludes selected desktop files -->
 <component type="System" context="User">
 <displayName>Exclude Desktop Files</displayName>
 <paths>
 <path type="File">%CSIDL_DESKTOP%</path>
 </paths>
 <role role="Settings">
 <rules>
 <unconditionalExclude>
 <objectSet>
 <pattern type="File">%CSIDL_DESKTOP% [TESTFILE.exe]</pattern>
 <pattern type="File">%CSIDL_DESKTOP% [*.pnagent]</pattern>
 </objectSet>
 </unconditionalExclude>
 </rules>
 </role>
 </component>

The following component can be added to exclude all copies of ‘TESTFILE.exe’, all MP3 files and all VHD files from being transferred to the new installation:

<component context="System" type="Documents"> 
<displayName>Unconditional Exluded Files</displayName> 
<role role="Data"> 
<rules> 
<unconditionalExclude> 
<objectSet> 
<script>MigXmlHelper.GenerateDrivePatterns ("* [TESTFILE.exe]", "Fixed")</script> 
<script>MigXmlHelper.GenerateDrivePatterns ("* [*.mp3]", "Fixed")</script> 
<script>MigXmlHelper.GenerateDrivePatterns ("* [*.vhd]", "Fixed")</script> 
<pattern type="File">C:\TEMP\* [*]</pattern>
<pattern type="File">C:\Drivers\* [*]</pattern>
</objectSet> 
</unconditionalExclude> 
</rules> 
</role> 
</component>

 

Example Configuration Changes: Exclude Start Menu Icons

The following component can be added to exclude listed start menu items:

 

<!-- This component excludes selected Start Menu files -->
<component type="System" context="User">
<displayName>Exclude Start Menu Files</displayName>
<paths>
<path type="File">C:\Documents and Settings\All Users\Start Menu</path>
</paths>
<role role="Settings">
<rules>
<unconditionalExclude>
<objectSet>
<pattern type="File">C:\Documents and Settings\All Users\Start Menu [Internet Explorer.lnk]</pattern>
<pattern type="File">C:\Documents and Settings\All Users\Start Menu [Microsoft Office Excel 2007.lnk]</pattern>
<pattern type="File">C:\Documents and Settings\All Users\Start Menu [Microsoft Office Outlook 2007.lnk]</pattern>
<pattern type="File">C:\Documents and Settings\All Users\Start Menu [Microsoft Office Word 2007.lnk]</pattern>
<pattern type="File">C:\Documents and Settings\All Users\Start Menu [Microsoft Update.lnk]</pattern>
</objectSet>
</unconditionalExclude>
</rules>
</role>
</component>