XMLtoE2B is a Windows GUI utility that will convert an XML created by the Windows Answer File Generator to an unattended XML answer file suitable for use with E2B or other Setup\Install processes (even if installing from a multiple image WIM file or to a UEFI\GPT system).
You do not need to install the bloatware Microsoft SDK or ADK, just to create an XML file! There is a much easier way using WAFG+XMLtoE2B! The Windows utility, XMLtoE2B.exe will convert a basic XML file that has been generated by the Windows Answer File Generator, to an XML answer file that is suitable for use with Easy2Boot (or any Windows install, even if you are not using E2B). If you find the WAFG website useful, please make a donation to them using the Contact link on their WAFG site.
XMLtoE2B makes creating automated, fully unattended answer files really easy!
Note: Please ensure the file extension .xml is lower-case for agFM or else it will not be listed.
Download XMLtoE2B – You will require a licence file for full functionality (free licence when you buy 3 or more eBooks).
New! E2B eBooks are now available (including a complete course on making a multiboot USB drive and an eBook on Installing Windows). If you have donated £10 or more (or have helped with the development of E2B or have bought 3 or more eBooks), please contact me for a licence file to make XMLtoE2B fully functional – or you can edit your XML file manually by following my blog post here.
- Download XMLtoE2B and extract the folder to your Windows Desktop (or any convenient drive\folder)
- Double-click on the XMLtoE2B.exe file to run it.
- Go to the correct page on the WAFG website by clicking one of the seven WAFG buttons in XMLtoE2B.
Fill in the WAFG web form (see screenshot above) and then save to an XML file (you can change the Product Key, ComputerName and disk configuration, etc. later).
Note: If you change ‘Install to Disk = 0’ to different number, you must check that the ‘WillWipeDisk’ section also uses the same disk number or else disk 0 will be wiped!
- Load the AFG XML file into memory. You must use an original WAFG-generated file – not a modified file.
- Add the WIM file image number – this is only required for a fully automated installation if you have a multiple-image ISO file such as the Install.wim file in Retail ISOs. Use a large number like 30 if you want to be prompted for an edition to install.
Change the other fields as required. You can either use a generic install key or an Activation key if you have one.
- Click on ‘Convert file’ – this converts the file that was loaded into memory in Step 2 into an XML file for E2B.
(optional) You can edit the text in the ‘Results’ window if required – e.g. you can change the comment field or change any other setting.
- Save the XML file to the E2B USB drive using the ‘Save text from Results window to a file’ button or view the file in NotePad.
To examine XML file that you have created, you may find the Microsoft utility XML Notepad useful.
WARNING: DO NOT REPLACE THE \AUTOUNATTEND.XML FILE ON THE E2B USB drive!
The \AutoUnattend.xml file in the root of the E2B USB drive must be at least 100K in size and it is wiped and updated by E2B when you boot to the Main menu. It must be as large as your largest XML file (so 100K should be large enough!). Do not change this files contents or size!
The various fields and checkboxes are explained below:
1 Generate XML file using Windows AFG - use one of the buttons to launch the correct WAFG page and create a WAFG XML file. 2 Load WAFG XML file - Loads the file that was generated by the Windows AFG web utility. Only use original WAFG files (not modified or non-WAFG generated files). 3 WIM file image number (optional) - If your ISO contains a \Sources\Install.wim (or .esd) file containing multiple Editions of Windows (e.g. Core + Pro), Setup will not know which image to extract onto the target hard disk. Setting an incorrect image number will result in you being prompted to choose an Edition if the image number is not consistent with the Product Key you have used (e.g. Index=6 + Windows 10 PROFESSIONAL Product Key). Note: Single Language versions of Win8/10 usually contain a single image - Home/Core only (image #1). More recent Microsoft Win10 Download ISOs with install.esd files contain the following images: 1 Cloud 2 CloudN 3 Core (Home) 4 Core N 5 Core Single Language 6 Education 7 Education N 8 Professional 9 Professional N 1 Cloud 2 CloudN 2 or 3 Core (Home) 2 or 4 Core N 3 or 5 Core Single Language 4 or 6 Education 5 or 7 Education N 1 or 6 or 8 Professional 7 or 9 Professional N Win11 Retail (note name is Windows 10 not Windows 11 !!!) 1 Windows 10 Home 2 Windows 10 Home N 3 Windows 10 Home Single Language 4 Windows 10 Education 5 Windows 10 Education N 6 Windows 10 Pro 7 Windows 10 Pro N 8 Windows 10 Pro Education 9 Windows 10 Pro Education N 10 Windows 10 Pro for Workstation 11 Windows 10 Pro for Workstation N Tip: You can use WinToUSB to list the available editions inside an .ISO file and their index numbers (or open the install.wim/.esd file and look at the 1.xml file inside). If you always want to be prompted before installation begins automatically, use an invalid image number - e.g. 20. Instead of an Index number you can use the exact Name - e.g. use '6' or 'Windows 10 Pro' but the name must exactly match what is in the install.esd xml file. Get Image Info - The very large Install.WIM or Install.ESD file inside a Windows Install ISO usually contains multiple Windows Editions. Click to see typical image numbers and then click OK to get the image information XML file from a .WIM or .ESD file. This large file is usually called \Sources\Install.wim or Install.esd and will need to be extracted from the Windows Install ISO file first. Alternatively, you can use 7zip to open the .xml file which can be found inside the large \sources\install.wim\esd file. UserName - Set the user account name here - e.g. 'Joe Bloggs' (if left blank a username of Administrator will be used and the Administrator account will be made active). The FullName, DisplayName and RegisteredOwner fields in the new XML file are always set to the UserName value. Password - set a password for the account (can leave this blank if no password is required). PlainText passwords (unencrypted) should be used. ComputerName - 15 characters or less (avoid 'special' characters and no spaces allowed). Leave empty or use * if you want a random name to be chosen. Cannot be same as UserName or 'NONE'. Prompt user for Computer Name - Setup will prompt the user to enter in his/her own ComputerName near the end of the build (Win7/8 only). SkipMachineOOBE must be set to false in order to get the user prompt to be visible. This option NOT SUPPORTED BY WINDOWS 10 which will choose a random computer name if no name is specified. Product Key (5x5) (optional) - If the WAFG XML file contained a product key, it will be displayed here. You can change it before converting the file. It must be a valid key and should match the WIM file image index number (i.e. if a PRO Edition is chosen, use a PRO product key). If a Volume Licence Edition of Windows is used, then use a generic volume licence key. Win11 uses the same keys as Win10. You can leave this blank (v2.0.52+). Tip: If the 5x5 ProductKey in the XML file contains ASKME-ASKME-ASKME-ASKME-ASKME then E2B will prompt you for a new Product Key (.ISO booting only, not .imgPTN files). Find a generic install Key - This takes you to the WAFG Keys web page that lists common generic install keys. These keys will NOT activate - they are just for installation purposes. If you click on Yes then a Retail Windows 10 Pro key will be set as the Product Key. Hide WiFi setup - The user will not be prompted to configure the Wireless network settings (SkipMachineOOBE should be unticked if you want the user to set up WiFi). Administrator account only - The User Account(s) will be removed from the XML file and SkipMachineOOBE will be set to true (otherwise you would be prompted to create a User Account at the end of the build). The password field will be used as the Administrator password. The Auto-Logon count is set to 5. Prompt user for Account Name - The Administrator account is disabled and the user will be prompted to create a user account and choose a name and password. The (disabled) Administrator password is set to whatever is in the password field. SkipMachineOOBE is set to false. SkipMachineOOBE - You can tick this to skip the final end-user OOBE questions (if any) which occur at the end of the Setup process. Incorrect or unanswered questions will use the Windows default setting. Only tick this after doing a test run with it unticked to ensure that all your options are answered as expected. Change Disk Partitioning - You can replace the disk configuration settings in the WAFG XML file with one of these two options. Single MBR Partition - For MBR installs (NOT UEFI/GPT), WAFG generates an XML file which comprises of two partitions, a 100MB hidden System Reserved partition and a second partition of maximum size. If you tick this box, only a single partition will be created as drive C: and the OS and boot files will be installed to it. Wipe Disk - Disk to completely erase Size (MB) - MAX = maximum size to fill disk, or enter for example 50000 for a 50,000MB partition. Only used if Single MBR Partition is selected. Windows Volume Label - You can change the volume label of the single MBR partition here. Only works if 'Single MBR Partition' is selected. Use Disk Config file - If ticked, the contents of a text file containing DiskConfiguration and ImageInstall sections will be used. This allows GPT and other partitions to be created for UEFI installs, etc. Browse - Browse for a DiskConfiguration file (some examples are included in the XMLtoE2B download). Disk Config file (*.diskcfg) - Shows the .diskcfg file that will be used to replace the DiskConfiguration and ImageInstall sections. If WillWipeDisk is set to 'false' in the XML file, then the target disk must be 'clean' (i.e. unpartitioned) for an automated install to begin. If the disk already contains partitions then the install will abort and the target disk will not be altered. Use CHOOSE_DISK (no wipe).diskcfg if you want to delete, create and format partitions manually first. The XML can then be used for both Legacy and UEFI boots. Add LOADISO code - If you are booting using a USB Removable Flash drive from ISO (or a USB HDD + WinHelper Removable Flash drive), you need to tick this box. If you are going to use the XML file with a .imgPTN image, you do not have to tick the box (if you leave it ticked, Setup will just briefly flash up a console window and then it will quickly disappear.). If the ISO boots using WIMBOOT (used in E2B v1.A8+ and agFM by default) then this is not required. + prompt user for repair - If this is ticked then \_ISO\e2b\firadisk\LOADISO.CMD will be used to load the ISO as a virtual DVD and it will ask if you want to repair the Hard Disk before installing Windows. If it is unticked, then \_ISO\e2b\firadisk\LOADISONP.cmd will be used to load the ISO and it will not prompt you to Repair the drive (i.e. it will immediately wipe and format the hard disk with no prompts whatsoever). The console repair menu may not work on Win8/10, so this is only useful for Win7 XML files. SDI_CHOCO config name (for ISO files) - Specify the SDI_CHOCO configuration name (and folder). The default one included with E2B is 'SDI_CHOCO', but you can create other configurations. Add SDI_CHOCO (for .imgPTN files) - This adds the lines into the XML file to call \e2b\stage1.cmd file. The configuration name is set in \e2b\stage2.cmd and by default it is 'SDI_CHOCO'. If you want to use a different configuration file other than SDI_CHOCO.cmd then you must edit \e2b\stage2.cmd yourself after switching to the .imgPTN file. Skip TPM checks (Win11 only) - Windows Setup will check that you have booted in Secure Mode, have a valid TPM, have sufficient disk space and RAM and have a compatible CPU. If you wish to bypass these checks then you can tick this box. v2.0.52 and later. Convert file - Converts the contents of the WAFG file that was loaded into memory in Step 2 and displays the result in the Results window. Convert to 32-bit (x86) - If the WAFG XML file is 64-bit only (e.g. UEFI-64 XML files), this allows you to convert the output for 32-bit UEFI Windows installs (x86). Save text from Results window to a file - You can edit the text in the Results window before saving it as a file. Any existing file of the same name will be overwritten. (Disabled if no valid licence file is found). It is best not to overwrite the original WAFG file because you may need to reload it if you need to re-make the XML file again. Copy Results window to NotePad - Creates a XMLTemp.txt file and opens it in NotePad. You can then edit it and save it with a different filename if you wish. This is useful for checking the results. (Disabled if no licence file is found)
Reference for Unattended settings
- Technet (Win8)
- MS Unattend Reference (Win10)
Win11 is 99.5% same as Win10.
WAFG will create MBR partitions in the XML settings. If you UEFI-boot, Windows Setup will fail because it expects GPT partitions (and an ESR partition). So if you UEFI-boot then you must use one of the EFI disk configuration files (or make your own .diskconfig file).
A blank ComputerName (or ‘*’) will result in Windows Setup making a random name up for you.
The ComputerName cannot be the same as any UserName or you will get login problems and account creation problems. The ComputerName cannot be ‘NONE’ (four letters).
Win10: When ComputerName=* the final Computer name is made from up from the first 7 characters of FullName and Organizaion and followed by a hyphen (-) and then 7 random characters, e.g.
Result >>> Computer name is set to UF552E2-N42R1CJ
Using an XML file, you can install a Win11 Home OS with a single local user account even if the computer has no internet connection (offline install).
The Product Key is specified in both the WindowsPE pass (which determines which Edition is to be installed, together with the WIM file Image number) and the Specialize pass (which is used when Windows is Activated). The two keys do not need to be the same. For instance, a KMS key may be used for the WindowsPE pass and a MAK key can be used for the Specialize Activation key. If no Specialize key is specified, the WindowsPE key (or the embedded OEM key in BIOS firmware) will be used for Activation.
If you do not specify a Product Key or an WIM Index, Setup will prompt you for an Edition to install. If the system has a manufacturers embedded OEM activation Product Key, only that matching Windows OEM Edition will be presented to the user in the selection list. This means if you bought a computer with Win10 Home OEM license but you want to install Win10 Pro, you must specify a Win10 Pro Product Key in the XML file.
Note that there are TWO different syntaxes for the two different positions for a Product Key in the XML file:
Install key in windowsPE pass:
<UserData> <ProductKey> <Key>VK7JG-NPHTM-C97JM-9MPGT-3V66T</Key> </ProductKey> </UserData> OR no install key... <UserData> <ProductKey> <Key></Key> </ProductKey> </UserData>
Activation key in Specialize pass:
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <ComputerName>XYZ</ComputerName> <ProductKey>VK7JG-NPHTM-C97JM-9MPGT-3V66T</ProductKey> </component> OR no activation key... <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <ComputerName>XYZ</ComputerName> </component>
If you do not have an activation product key, then delete the entire <ProductKey>xxxxxxx</ProductKey> line from the Specialize – Microsoft-Windows-Shell-Setup section completely (highlighted in example above). If <ProductKey></ProductKey> is used you will get a Setup error after Windows install reboots to the Specialize phase.
If you do not specify an installation key then use <Key></Key> (do not delete the whole line, just delete the 29-character key string).
Notes for Windows AFG
User Accounts – You must either add a User Account or set the AutoLogon account name to ‘Administrator’ (which enables the Administrator account that is normally disabled). If neither is done and SkipMachineOOBE is set to false, the user will be prompted to add a User Account near the end of the build.
For Windows 10 – If no User Name is set and autologon is disabled you will get a ‘Windows could not complete the installation’ error near the end of installation if SkipMachineOOBE is true. If you want to also enable the Administrtaor account, use a NET USER command after installation (e.g. using SDI_CHOCO – MyStartup.cmd).
You may also need to enable both the the OnlineAccountsScreens settings in the XML file if you want to prompt the user to enter an account name.
SkipMachineOOBE – This should normally be set to ‘false’. All testing should be done using ‘false’. Once it is working correctly, setting it to ‘true’ may suppress some user prompts if you did not add an ‘answer’ into the XML file, but you will need to carefully check that the desired defaults are correct.
The best way for Windows 10 is to untick SkipMachineOOBE and ensure the XML file contains all the correct settings in the oobeSystem pass – see here for more details on SkipMachineOOBE.
(Win7/8) Note that there is a ‘catch 22’ situation – if you want to be prompted for a ComputerName at the end of the build then SkipMachineOOBE=unticked=false, however if you want to enable the Admin account and have no other user accounts created, then SkipMachineOOBE=ticked=true (otherwise the user will be prompted to create an account). You cannot be prompted to enter a ComputerName and enable the Administrator and have no prompt to create a new User Account.Setting the AutoLogon account name to ‘Administrator’ (with AutoLogon enabled) will enable the Administrator account.
AutoLogon=Administrator + SkipMachineOOBE=false + Add User Account will work. To do this you must create the WAFG XML file with a User Account name, Prompt user for ComputerName=ticked (SkipMachineOOB=unticked) – then after clicking Convert loaded file, edit the Results window and set the AutoLogon UserName to ‘Administrator’.
In all versions of Windows the account creation phase during OOBE is skipped when at least one user account is created through the UserAccounts section of the same unattend file. ‘In Windows 10, if you enable AutoLogon, the OS will skip the user account creation phase during OOBE. This is a change from previous versions of Windows. This change only applies when no user account is created by unattend such as when setting AutoLogon for a built-in or existing account like Administrator or Guest. Microsoft recommends using unattend to create at least one user account in the Administrators group to ensure that the device can be managed after the autologon is complete. Make sure AutoLogon is disabled on computers that are delivered to customers. See here and How to Enable and Disable the Built-in Administrator Account for more information.’
If you want the Administrator account to be enabled, then use SDI_CHOCO and add a NET USER command to the MyStartup.cmd script (e.g. net user Administrator newpassword /active:yes ).
SDI_CHOCO (run a batch file)
If you want to use the SDI_CHOCO feature (e.g. to run any batch file during the Specialize or OOBE pass), you must add some more lines into the XML file using the checkboxes provided.
If you want to use SDI_CHOCO from a .imgPTN file, you must tick the ‘Add SDI_CHOCO (for .imgPTN files)‘ checkbox. This ensures that \e2b\stage1.cmd is called. However, note that the configuration name is set in \e2b\stage2.cmd, so you must also edit \e2b\stage2.cmd which is inside the .imgPTN image if you want to use a different SDI_CHOCO configuration set. If using agFM and directly UEFI-booting from an ISO, the ‘Add SDI_CHOCO (for .imgPTN files)‘ checkbox should be unticked.
The SDI_CHOCO config name (for ISO files) checkbox is only required when NOT using E2B wimboot. It will not hurt to include it, but for most cases it is not needed for the latest versions of E2B and agFM.
How to use the new XML file
If using the legacy E2B menu system or the legacy\UEFI agFM menu system, you can just select the ISO file and XML file. That’s it!
Just make sure the XML file is in the same folder as the ISO file.
In XMLtoE2B you should use ‘CHOOSE_DISK (no wipe).diskcfg’ as a disk config file if you don’t want any disks to be wiped and formatted automatically.
WARNING: If the XML file installs to Drive 0, then do not use it with a Virtual Machine (e.g. Virtual Box) unless the target virtual disk is Drive 0. If the E2B USB drive is drive 0 it will be wiped! You must use the Fixed-Disk #2 method but also modify the DiskID value inside the XML file before use. See here for more information.
The instructions below only apply if you want to use a different method…
If you have a Removable E2B USB Flash drive AND do NOT use WIMBOOT (the WIMBOOT method is the normal default method)…
- For ISO booting, just copy the XML file to the correct Windows folder (e.g. \_ISO\WINDOWS\WIN8 for Windows 8 and 8.1).
Give the XML file a suitable name (e.g. Win8.1Pro_AutoWipe_User1_max.xml. (MBR systems only).
- For a FAT32 Windows Install .imgPTN file, switch to the .imgPTN file’s CSM menu and then quit (F10) or use SWITCH_E2B.exe. Then copy the XML file to the root of the image partition (not the E2B partition which contains the \_ISO folder!) and name it \AutoUnattend.xml.
Tip: If MBR-booting, press F7 to boot from the hard disk after the first reboot by Setup (or set the default menu option to the F7 menu entry).
If you have a Fixed-Disk type of E2B USB drive (e.g. USB-HDD)
- (MBR systems only): For ISO booting, use a ‘Helper’ Removable USB Flash drive with the E2B drive and follow step 1 above (not required if E2B uses WIMBOOT).
- (MBR and UEFI systems): For a FAT32 Windows Install .imgPTN file, switch to the .imgPTN file’s CSM menu or use SWITCH_E2B.exe. Then mount the \Sources\boot.wim image #2 file using GImageX and copy the XML file to the mounted folder and name it \AutoUnattend.xml.
WARNING: If you UEFI-boot and the XML file auto-partitions the target drive, then any system that you boot to will automatically get it’s hard disk wiped! Take care when UEFI-booting from the USB drive in this state! If you boot to it on your office system, it will wipe the hard disk!
.imgPTN + Windows 10 only – recent Windows 10 versions will use a \AutoUnattend.xml file if the root of the FAT32 .imgPTN image. So simply copy the AutoUnattend.xml file to the root of the E2B drive after the .imgPTN image has been ‘switched’ in.
See also ‘How to automate an install from a .imgPTN Windows Install file‘.
If you are prompted to first select a Locale, etc. – check that the Locale and Language settings under the settings pass=”windowsPE” section and other sections are correct. WAFG does not always set this correctly. For instance, if you have an English UK ISO version, the Locale and Language settings must be for the UK, i.e. set en-GB and not en-US (in both amd86 and x86 sections of “Microsoft-Windows-International-Core-WinPE”).
If the XML file does not seem to run, check the X:\Windows\Setupact.log file to see if Setup found an AutoUnattend.xml file, then check the X:\Windows\Panther\Setupact.log to see how it interpreted the settings in the XML file. If there is a failure after rebooting, check the C:\Windows\Panther\Setupact.log file and other log files as detailed here. The Setuperr.log file in the same folder will often point you to the problem.
If the Setupact.log identifies a section of the XML file that includes the Product Key, then the error could be that you have used a Product Key for a different Edition from the one that you actually installed. Google the Product Key and also check the install.wim inside the ISO to ensure you have used the correct IMAGE INDEX number – i.e. Win Ultimate was installed and Ultimate Product Key was used! Also there are Retail/OEM Product keys and there are Volume Licence Product keys – use the correct one for the Edition that you install or else the Key may cause an error or not activate.
If the oobeSystem stage fails, check the C:\Windows\Panther\UnattendGC folder.
If the XML file seems to be ignored by Setup – check it for syntax errors.
If Setup stops with an error message about not being able to set an Active partition – you are probably trying to create an MBR type disk whilst booting via UEFI. If you want to create an MBR disk you must boot in MBR-mode.
If Setup stops with an error message about ‘the selected disk is of the GPT partition style’ – you are probably trying to create a GPT disk whilst booting via MBR. If you want to create a GPT (UEFI) disk, you must boot in UEFI-mode.
‘Windows could not set a partition Active on disk 0’ – if you are UEFI-booting, you cannot make an MBR partition, you must use a GPT disk configuration.
If you think there is a bug in XMLtoE2B – please report it and send me the three debug*.* files immediately after generating the XML file.
If you have a WipeDisk section in the XML and the WIM Index number and product key are correct, as soon as you boot to the ISO it will destroy the target disk and begin the installation without any warning. To prevent this, use a high invalid Index number of say 20. If you have used a Product Key but an invalid index number, Setup will prompt you with only one choice of Windows edition. If you have deleted the Product Key from the XML, Setup will present the full list of Editions to the user UNLESS the system contains a manufacturers OEM embedded Product Key – in which case only that Edition will be selectable.
Change the ComputerName and UserName each time
MBR-booting from .ISO file
It is possible to prompt the user for a ComputerName and UserName before you start the install, and then E2B will modify the XML file before Setup begins (they must NOT be the same!).
See here for details and also see the WIN10_Prompt_for_PCNAME_and_UNAME.mnu file in the \_ISO\docs\Sample mnu Files\Windows folder.
See also WIN10_Prompt_for_UNAME_auto_serial_COMPNAME.mnu for a method of setting the ComputerName to contain the Serial Number of the system.
The Sample Mnu file WIN10_Prompt_User_for_XML_settings.mnu prompts the user for various XML settings and then modifies the XML file before it is used. This allows you to use the same XML file each time, but specify the UserName, ComputerName, FullName, RegisteredOwner, RegisteredOrganization, etc. before you start each build (E2B v1.A1+).
UEFI-booting from .ISO file
eBook #4 describes a method that allows you to select various XML settings (or even different XML files) and change the Home or Pro key, username and computername before Setup is launched.
See the example .cfg files provided in the 2nd agFM partition folder \e2b\Sample agFM menu files\WINDOWS.