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 drive and connect it to the computer.autounattend.xml file to the root folder of the USB drive and connect it to the computer.autoinst.flp or autoinst.iso are attached: 
Win11_25H2_English_x64.isoC:\ Program Files (x86)\ VMware\ VMware Workstation\ windows.isounattend.iso image downloaded earlierautounattend.xml file and not the one provided by VirtualBox, check the Skip Unattended Installation setting: 
Win11_25H2_English_x64.isoC:\ Program Files\ Oracle\ VirtualBox\ VBoxGuestAdditions.isounattend.iso image downloaded earlier
Win11_25H2_English_x64.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 downloaded earlier:
Win11_25H2_English_x64.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.
Driver packages suitable for automatic installation typically contain files with .inf, .sys and .cat extensions. Drivers packaged as .exe files are not suited for this kind of setup, but many vendors offer both types of packages. For example, Intel's Wi-Fi drivers are available as two downloads, namely WiFi-24.20.0-Driver64-Win10-Win11.exe and WiFi-24.20.0-Driver64-Win10-Win11.zip. Only the latter one is suitable for automatic installation.
To automatically install the drivers in the .zip archive, simply 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 Always show all tray icons setting in Windows 11, run this command in an elevated PowerShell session:
Get-ScheduledTask -TaskName 'ShowAllTrayIcons' | Unregister-ScheduledTask -Confirm:$false;To undo the Use classic context (right-click) menu in Windows 11 setting, run this command in PowerShell:
Remove-Item -LiteralPath 'Registry::HKCU\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\InprocServer32';To undo the Disable User Account Control (UAC) 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 Allow execution of PowerShell script files setting, run this command in an elevated PowerShell session:
Set-ExecutionPolicy -Scope 'LocalMachine' -ExecutionPolicy 'Undefined' -Force;When the Disable app suggestions / Content Delivery Manager 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 ShowAllTrayIcons, which periodically sets all tray icons visible, 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";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 2;"';
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.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 its character encoding:
<?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 | Windows Setup logs for PE stage. Inspect these files when Windows Setup does not seem to apply your autounattend.xml file. |
|
Windows PE | Output of diskpart script to partition and format your hard drive. |
|
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, file 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.