Pages

Thursday, March 28, 2019

Windows 10 fails to sysprep with the error message: “A fatal error occurred while trying to sysprep the machine.”

Problem

You attempt to run sysprep on a Windows 10 operating system by manually navigating to C:\windows\system32\sysprep to execute the sysprep.exe:

… but receive the following error:

System Preparation Tool 3.14

A fatal error occurred while trying to sysprep the machine.

You navigate to the directory:

C:\windows\system32\sysprep\Panther

.. and find the following the content in the setuperr.log file:

2019-03-14 07:29:46, Error [0x0f0073] SYSPRP RunExternalDlls:Not running DLLs; either the machine is in an invalid state or we couldn't update the recorded state, dwRet = 0x1f

2019-03-14 07:29:46, Error [0x0f00ae] SYSPRP WinMain:Hit failure while processing sysprep cleanup external providers; hr = 0x8007001f

Solution

One of the first items to check is that the rearm limit has not been reached by executing slmgr.vbs /dlv to review the Remaining Windows rearm count (the desktop I was working on has not reached 0):

If the Remaining Windows rearm count hasn’t been exceeded then proceed to check the following registry keys:

HKEY_LOCAL_MACHINE\SYSTEM\Setup\Status\SysprepStatus\

Verify that the CleanupState registry key is set to 2:

Verify that the GeneralizationState is set to 7 (the desktop I was working on had the value of 3):

Uninstall and reinstall the MSDTC with the following commands:

msdtc -uninstall

msdtc –install

Navigate to the following registry key:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\

Verify that the SkipRearm key has the value of 1:

Rerunning the sysprep.exe executable to start the sysprep process should work as expected now: