--- title: Custom XML Examples (Windows 10) description: Use custom XML examples to learn how to migrate an unsupported application, migrate files and registry keys, and migrate the My Videos folder. ms.reviewer: manager: dougeby ms.author: aaroncz ms.prod: w10 author: aczechowski ms.topic: article --- # Custom XML Examples ## Example 1: Migrating an Unsupported Application The following is a template for the sections that you need to migrate your application. The template isn't functional on its own, but you can use it to write your own .xml file. ``` xml 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 sample is a custom .xml file named CustomFile.xml that migrates My Videos for all users, if the folder exists on the source computer. - **Sample condition**: Verifies that My Videos exists on the source computer: `MigXmlHelper.DoesObjectExist("File","%CSIDL_MYVIDEO%")` - **Sample filter**: Filters out the shortcuts in My Videos that don't resolve on the destination computer: `` This has no effect on files that aren't shortcuts. For example, if there's 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. - **Sample pattern**: Migrates My Videos for all users: `%CSIDL_MYVIDEO%* [*]` **XML file** ```xml My Video MigXmlHelper.DoesObjectExist("File","%CSIDL_MYVIDEO%") %CSIDL_MYVIDEO%\* [*] ``` ## Example 3: Migrating Files and Registry Keys The sample patterns describe the behavior in the following example .xml file. - **Sample pattern**: Migrates all instances of the file Usmttestfile.txt from all subdirectories under `%ProgramFiles%\USMTTestFolder`: `%ProgramFiles%\USMTTestFolder* [USMTTestFile.txt]` - **Sample pattern**: Migrates the whole directory under `%ProgramFiles%\USMTDIRTestFolder`: `%ProgramFiles%\USMTDIRTestFolder* []` - **Sample pattern**: Migrates all instances of MyKey under `HKCU\Software\USMTTESTKEY`: `HKCU\Software\USMTTESTKEY* [MyKey]` - **Sample pattern**: Migrates the entire registry hive under `HKLM\Software\USMTTESTKEY`: `HKLM\Software\USMTTESTKEY* []` **XML file** ``` xml 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 `` tags in the code. ``` xml 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)