Invictus
Invictus

Reputation: 13

Unattend.xml does not work on first boot of new PC

I created unattend.xml file using Windows System Image Manager. It works when I run SysPrep on the PC but it does not work when newly installed Windows is starting. The whole point is to avoid OOBE during first computer boot.. Here is the code:

<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
    <settings pass="oobeSystem">
        <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <OOBE>
                <HideEULAPage>true</HideEULAPage>
                <HideLocalAccountScreen>true</HideLocalAccountScreen>
                <HideOEMRegistrationScreen>true</HideOEMRegistrationScreen>
                <HideOnlineAccountScreens>true</HideOnlineAccountScreens>
                <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>
                <ProtectYourPC>3</ProtectYourPC>
            </OOBE>
            <UserAccounts>
                <LocalAccounts>
                    <LocalAccount wcm:action="add">
                        <DisplayName>User</DisplayName>
                        <Group>Administrators</Group>
                        <Name>User</Name>
                    </LocalAccount>
                </LocalAccounts>
            </UserAccounts>
        </component>
        <component name="Microsoft-Windows-International-Core" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <InputLocale>en-US</InputLocale>
            <SystemLocale>en-US</SystemLocale>
            <UILanguage>en-US</UILanguage>
            <UserLocale>en-US</UserLocale>
            <UILanguageFallback>en-US</UILanguageFallback>
        </component>
    </settings>
    <cpi:offlineImage cpi:source="wim:c:/users/user/desktop/install.wim#Windows10" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
</unattend>

Do you have idea why?

Thank you

Upvotes: 0

Views: 1203

Answers (1)

Brian D.
Brian D.

Reputation: 184

Better late then never I guess.

I got around this by using a 2 prong approach. The general idea is to use a provisioning package to copy files to the machine and run them.

One of the commands you run will be to sysprep the machine with the unattend.xml file that skips OOBE (and does whatever else you want).

The provisioning package can copy other app installers to the machine to run which is nice.

You will need an oobe.bat and an unattend.xml file at the least.

So in the new provisioning package (made with Windows Configuration Designer) add all the files you will need to the Runtime Settings > ProvisioingCommands > DeviceContext > CommandFiles. Here I have oobe.bat, unattend.xml, and an app installer I need to run.

Then under the Runtime Settings > ProvisioingCommands > DeviceContext > CommandLine run the oobe.bat with the command cmd /c "oobe.bat"

Inside the bat file run whatever commands you want/need like changing power options, disabling the firewall, install apps you added above, etc.

Make the final command sysprep the machine with the unattend.xml (which you should make skip OOBE). with the command

%windir%\System32\Sysprep\sysprep.exe /oobe /reboot /unattend:%CD%\unattend.xml

At the OOBE screen insert the thumbdrive with the ppkg and cat files from the provisioning package. All the files you added are included so they don't need to be on the thumb drive.

I hope these instructions are complete enough to help the next person trying to figure this out.

Upvotes: 0

Related Questions