--- title: Custom XML Examples (Windows 10) description: Custom XML Examples ms.assetid: 48f441d9-6c66-43ef-91e9-7c78cde6fcc0 ms.prod: w10 ms.mktglfcycl: deploy ms.sitesec: library author: greg-lindsay --- # Custom XML Examples **Note**   Because the tables in this topic are wide, you may need to adjust the width of its window.   ## In This Topic: - [Example 1: Migrating an Unsupported Application](#example) - [Example 2: Migrating the My Videos Folder](#example2) - [Example 3: Migrating Files and Registry Keys](#example3) - [Example 4: Migrating Specific Folders from Various Locations](#example4) ## Example 1: Migrating an Unsupported Application The following is a template for the sections that you need to migrate your application. The template is not functional on its own, but you can use it to write your own .xml file. ``` syntax Some Application value MigXMLHelper.DoesObjectExist("Registry","HKLM\Software\MyApp [win32_version]") MigXMLHelper.DoesFileVersionMatch("%MyAppExePath%","ProductVersion","8.*") MigXMLHelper.DoesFileVersionMatch("%MyAppExePath%","ProductVersion","9.*") HKCU\Software\MyApp\Toolbar\* [*] HKCU\Software\MyApp\ListView\* [*] HKCU\Software\MyApp [ShowTips] HKCU\Software\MyApp\Toolbar\* [*] HKCU\Software\MyApp\ListView\* [*] HKCU\Software\MyApp [ShowTips] HKCU\Software\MyApp [Display] ``` ## Example 2: Migrating the My Videos Folder The following is a custom .xml file named CustomFile.xml that migrates My Videos for all users, if the folder exists on the source computer.
Code Behavior
<condition>MigXmlHelper.DoesObjectExist("File","%CSIDL_MYVIDEO%")</condition>

Verifies that My Videos exists on the source computer.

<include filter='MigXmlHelper.IgnoreIrrelevantLinks()'>

Filters out the shortcuts in My Videos that do not resolve on the destination computer. This has no effect on files that are not shortcuts. For example, if there is a shortcut in My Videos on the source computer that points to C:\Folder1, that shortcut will be migrated only if C:\Folder1 exists on the destination computer. However, all other files, such as .mp3 files, migrate without any filtering.

<pattern type="File">%CSIDL_MYVIDEO%\* [*]</pattern>

Migrates My Videos for all users.

  ``` syntax My Video MigXmlHelper.DoesObjectExist("File","%CSIDL_MYVIDEO%") %CSIDL_MYVIDEO%\* [*] ``` ## Example 3: Migrating Files and Registry Keys This table describes the behavior in the following example .xml file.
Code Behavior
<pattern type="File">%ProgramFiles%\USMTTestFolder\* [USMTTestFile.txt]</pattern>

Migrates all instances of the file Usmttestfile.txt from all sub-directories under %ProgramFiles%\USMTTestFolder.

<pattern type="File">%ProgramFiles%\USMTDIRTestFolder\* [*]</pattern>

Migrates the whole directory under %ProgramFiles%\USMTDIRTestFolder.

<pattern type="Registry">HKCU\Software\USMTTESTKEY\* [MyKey]</pattern>

Migrates all instances of MyKey under HKCU\Software\USMTTESTKEY.

<pattern type="Registry">HKLM\Software\USMTTESTKEY\* [*]</pattern>

Migrates the entire registry hive under HKLM\Software\USMTTESTKEY.

  ``` syntax File Migration Test %ProgramFiles%\USMTTestFolder\* [USMTTestFile.txt] %ProgramFiles%\USMTDIRTestFolder\* [*] Registry Migration Test HKCU\Software\USMTTESTKEY\* [MyKey] HKLM\Software\USMTTESTKEY\* [*] ``` ## Example 4: Migrating Specific Folders from Various Locations The behavior for this custom .xml file is described within the <`displayName`> tags in the code. ``` syntax Component to migrate all Engineering Drafts subfolders without documents in this folder C:\EngineeringDrafts\* [*] C:\EngineeringDrafts\ [*] Component to migrate all user documents except Sample.doc C:\UserDocuments\* [*] C:\UserDocuments\ [Sample.doc] Component to migrate all Requests folders on any drive on the computer Component to migrate all Presentations folder from any location on the C: drive C:\*\Presentations\* [*] C:\Presentations\* [*] ``` ## Related topics [USMT XML Reference](usmt-xml-reference.md) [Customize USMT XML Files](usmt-customize-xml-files.md)