autounattend.xml files to install Windows 10/11Windows Setup will automatically search for autounattend.xml files at various locations, including the root folders of each removable drive. Therefore, to perform unattended Windows installations, there is no need to use third-party software or to modify .iso or .wim files. Just follow these steps:
autounattend.xml file to the root folder of a USB flash drive and connect it to the computer.autounattend.xml file to the root folder of the USB flash drive and connect it to the computer.unattend.iso image.
Win11_25H2_English_x64_v2.iso. Since we want to use our own autounattend.xml file and not the one provided by VirtualBox, deselect the Proceed with Unattended Installation setting:
C:\ Program Files\ Oracle\ VirtualBox\ VBoxGuestAdditions.isounattend.iso image downloaded earlier
unattend.iso image.autoinst.flp or autoinst.iso are attached: 
Win11_25H2_English_x64_v2.isoC:\ Program Files (x86)\ VMware\ VMware Workstation\ windows.isounattend.iso image downloaded earlier
You can now use a SCSI hard disk and a VirtIO SCSI single controller because the autounattend.xml file will automatically install the necessary drivers at the beginning of the PE stage. You will also have network connectivity throughout Windows Setup.
unattend.iso image.Win11_25H2_English_x64_v2.isovirtio-win-*.iso image, which contains the virtio-win-guest-tools.exe installer and can be downloaded in its
latest stable or its
most recent version
unattend.iso image downloaded earlier
vmguest.iso image because it is
no longer needed or included in Hyper-V.
unattend.iso image.unattend.iso image downloaded earlier:
unattend.iso image.Win11_25H2_English_x64_v2.isoprl-tools-win.iso or prl-tools-win-arm.iso), which can be found at / Applications/ Parallels Desktop.app/ Contents/ Resources/ Toolsunattend.iso image downloaded earlier$OEM$ folderYou can instruct Windows Setup to look for a folder named $OEM$ on your installation medium and recursively copy its contents to the target system during the PE stage. When you use an autounattend.xml file, include the <UseConfigurationSet>true</UseConfigurationSet> element to trigger this behavior. In my generator, checking the Use a distribution share / configuration set option will create this element.
See Microsoft's documentation for how the $OEM$ folder and its subfolders are processed. For example, you could create your installation medium as follows:
During the PE stage, Windows Setup will copy the file in the $OEM$ folder to the target volume, preserving its relative path. Together with the applied Windows image, the C:\ drive would look like this when the installation has finished:
$WinPEDriver$ folderWhen you place a folder named $WinPEDriver$ on your installation medium, Windows Setup will recursively scan this folder for .inf files and automatically install the corresponding device drivers during the PE stage.
Some vendors provide driver packages simply as .zip files, others may use self-extracting archives as .exe files. In any case, a suitable device driver will typically consist of one .inf, .sys and .cat file each. For example, to install Intel Wi-Fi drivers, download the .zip file, unzip it and place its contents in the $WinPEDriver$ folder. The folder structure on your installation medium would then look like this:
To undo behaviors set through the Lock key settings: section, run this command in an elevated PowerShell session:
Remove-ItemProperty -LiteralPath 'Registry::HKLM\SYSTEM\CurrentControlSet\Control\Keyboard Layout' -Name 'Scancode Map';To undo the setting in Windows 11, run this command in an elevated PowerShell session:
Get-ScheduledTask -TaskName 'ShowAllTrayIcons' | Unregister-ScheduledTask -Confirm:$false;That scheduled task had previously executed VBScript code. VBScript has since been deprecated by Microsoft. To migrate the task from VBScript to PowerShell, run this command in an elevated PowerShell session:
$action = New-ScheduledTaskAction -Execute '%windir%\System32\conhost.exe' -Argument '--headless %windir%\System32\WindowsPowerShell\v1.0\powershell.exe -WindowStyle Hidden -NoProfile -NonInteractive -Command "Set-ItemProperty -Path ''Registry::HKCU\Control Panel\NotifyIconSettings\*'' -Name ''IsPromoted'' -Value 1 -Type ''DWord'';"';
Set-ScheduledTask -TaskName 'ShowAllTrayIcons' -Action $action;
Remove-Item -LiteralPath "${env:windir}\Setup\Scripts\ShowAllTrayIcons.vbs";To undo the setting, run this command in PowerShell:
Remove-Item -LiteralPath 'Registry::HKCU\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\InprocServer32';To undo the setting, run this command in an elevated PowerShell session and reboot the computer:
Set-ItemProperty -LiteralPath 'Registry::HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System' -Name 'EnableLUA' -Value 1 -Type 'DWord';To undo the setting, run this command in an elevated PowerShell session:
Set-ExecutionPolicy -Scope 'LocalMachine' -ExecutionPolicy 'Undefined' -Force;When the setting was checked, as a side effect the Manage devices button in the Mobile devices section in Settings is disabled. To enable that button, run this command in an elevated PowerShell session and reboot the computer:
Set-ItemProperty -LiteralPath 'Registry::HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\CloudContent' -Name 'DisableWindowsConsumerFeatures' -Value 0 -Type 'DWord';The scheduled task MoveActiveHours, which periodically moves your active hours in order to prevent Windows Update from rebooting your computer, had previously executed VBScript code. VBScript has since been deprecated by Microsoft. To migrate the task from VBScript to PowerShell, run this command in an elevated PowerShell session:
$action = New-ScheduledTaskAction -Execute '%windir%\System32\conhost.exe' -Argument '--headless %windir%\System32\WindowsPowerShell\v1.0\powershell.exe -WindowStyle Hidden -NoProfile -NonInteractive -Command "$p = @{ LiteralPath = ''Registry::HKLM\Software\Microsoft\WindowsUpdate\UX\Settings''; Type = ''DWord''; }; $h = [datetime]::Now.Hour; Set-ItemProperty @p -Name ''ActiveHoursStart'' -Value (($h + 23) % 24); Set-ItemProperty @p -Name ''ActiveHoursEnd'' -Value (($h + 11) % 24); Set-ItemProperty @p -Name ''SmartActiveHoursState'' -Value 0;"';
Set-ScheduledTask -TaskName 'MoveActiveHours' -Action $action;
Remove-Item -LiteralPath "${env:windir}\Setup\Scripts\MoveActiveHours.vbs";autounattend.xml files generated by this service work with any version of Windows 10 and Windows 11, including 24H2 and 25H2, in both ConX and legacy setup modes. When an answer file is not processed as expected, check for the following:
autounattend.xml file into the Windows Setup files that is higher up in the search order and thus takes preference over your autounattend.xml file. Check the X:\Windows\setupact.log log file to determine which answer files are present. Also note that you can easily create Windows installation media without additional software.Win11_25H2_English_x64_v2.iso. There is hardly a reason to modify .iso or .wim files anyway – use custom scripts in your autounattend.xml file instead.autounattend.xml file manually, pay attention to these character encoding aspects:
<?xml version="1.0" encoding="utf-8"?> XML declaration.  instead.The unattended installation writes error messages and other output to various log files:
| Path | Stage | Contents |
|---|---|---|
|
Windows PE | Inspect these files when Windows Setup does not seem to apply your autounattend.xml file or when Windows Setup unexpectedly asks for device drivers. |
|
After first reboot | Windows Setup logs for all stages after Windows PE. Inspect these files when Windows Setup displays an error message. |
|
After Windows has been installed | Output of custom scripts, WLAN setup and various other configuration actions. |
|
After Windows has been installed | Logs results of bloatware removal. |
|
After Windows has been installed | Output of PowerShell script that sets your computer's name. |
During Windows Setup, several files are created that may contain sensitive data:
autounattend.xml file at C:\Windows\Panther\unattend.xml and C:\Windows\Panther\unattend-original.xml. These files may contain account passwords.C:\Windows\Setup\Scripts\Wifi.xml will contain the Wi-Fi profile you entered, including the password.Previous versions of the generator did not delete these files. The current version of the generator does delete them, unless the Keep sensitive files checkbox is selected.
Furthermore, files embeddeded in the autounattend.xml file will be extracted to the C:\Windows\Setup\Scripts folder. Check these files when you have entered sensitive data in custom scripts.