TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/flick9000/winscript/llms.txt
Use this file to discover all available pages before exploring further.
autounattend.xml file produced by Winscript is a valid, self-contained Windows answer file — but it also uses several techniques that go beyond the baseline Microsoft unattend schema. This page documents those internals so you can understand exactly what runs during setup and, if needed, extend or modify the generated file for your own requirements.
Specialize Phase
Thespecialize pass runs after the OS image is copied to disk but before the first boot into the installed system. Winscript extracts and then executes Specialize.ps1 during this pass. The script runs three registry operations in sequence, reporting progress to a log file:
1. Disables CloudOptimizedContent
BypassNRO (Bypass Network Requirement at OOBE) is required on Windows 11 to guarantee that the system allows local account creation even if a network is available. Without this, Windows 11 may still prompt for a Microsoft account.
3. Disables Windows Update during setup
Write-Progress to display a progress bar in the PowerShell window during execution. The full output — including each command’s text, its start time, and execution duration — is written to:
FirstLogon Phase
FirstLogon.ps1 runs as a FirstLogonCommand in the oobeSystem pass — meaning it executes the first time a user logs into the desktop after OOBE completes. It performs three tasks in order:
1. Re-enables network adapters
specialize pass. This command brings them all back online so the desktop session has internet access.
2. Re-enables Windows Update
autounattend.xml.
Script Extraction Mechanism
TheExtensions block in the generated XML uses a custom namespace (urn:winscript:unattend) to store both the scripts themselves and the logic needed to write them to disk. This is a Winscript-specific design and is not part of the standard Microsoft unattend schema.
The
Extensions namespace urn:winscript:unattend is not recognised or processed by the Windows Setup engine. It is read exclusively by the inline PowerShell ExtractScript scriptblock that Winscript invokes during the specialize pass.How ExtractScript works
During the specialize pass, the first RunSynchronousCommand invokes PowerShell to load the answer file as an XML document and execute the ExtractScript scriptblock inline:
<File> child of Extensions, resolves the path attribute (expanding any environment variables), creates the parent directory if it does not exist, selects the correct encoding based on the file extension, and writes the file to disk:
Encoding behaviour
The script selects encoding based on file extension:| Extension | Encoding |
|---|---|
.ps1, .xml | UTF-8 (with BOM) |
.reg, .vbs, .js | UTF-16 LE (with BOM) |
| All others | System default encoding |
Adding your own embedded files
You can manually add additional<File> elements to the Extensions block to have arbitrary files extracted during the specialize phase. Each element must have a path attribute pointing to the absolute destination path on the target system, with any embedded special XML characters properly escaped. The ExtractScript logic handles all file types that match the encoding table above automatically.
Product Key
The generated XML includes a placeholder product key in thewindowsPE pass:
WillShowUI to Always means Windows Setup will always display the product key entry screen, regardless of whether the placeholder key is present. This is intentional — Winscript does not embed a real product key, so you will be prompted to enter one (or skip it, if installing an evaluation edition) during setup. If you want to supply a key automatically, replace the placeholder value and change WillShowUI to Never.