--- 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. manager: aaroncz ms.author: frankroj ms.prod: windows-client author: frankroj ms.topic: article ms.technology: itpro-deploy ms.date: 11/01/2022 --- # Custom XML Examples ## Example 1: Migrating an unsupported application The following template 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. **Template**
Expand to show Example 1 application template: ```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 filter 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**
Expand to show Example 2 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**
Expand to show Example 3 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 file**
Expand to show Example 4 XML file: ```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 articles [USMT XML reference](usmt-xml-reference.md) [Customize USMT XML files](usmt-customize-xml-files.md)