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:

8 comments:

Richard Rodriguez said...

Hey man, was scouring the internet for a while for a fix for this, since I was trying to build an image with some other applications in it and this saved me from rebuilding it. Thank you!

Sam said...

Top post, really appreciate you taking the time to make it, thanks

Anonymous said...

This worked for me. Tks for taking the time to post it!!!!

Unknown said...

Hi, I tried everything you posted and I still receiving the error. I'm trying to Sysprep Windows version 21H1. The last version I was able to Sysprep was 1909. Any help would be appreciated.

Thanks

Anonymous said...

Hello
Same problem: I tried everything you posted and I still receiving the error. I'm trying to Sysprep Windows version 21H1...

Unknown said...

Ok, I guess 21H1 does Sysprep...but only on a clean install. What sucks is the amount of time it will take to rebuild the current image on a clean install.

Anonymous said...

I finally succeeded on W10 21h1 !

First: https://docs.microsoft.com/en-us/answers/questions/515817/windows-10-sysprep-error-a-fatal-error-occurred-wh.html

Then I execute the script:

"@ECHO OFF
reg add "HKLM\SYSTEM\Setup\Status\Sysprepstatus" /v CleanupState /t REG_DWORD /d 00000002 /F
reg add "HKLM\SYSTEM\Setup\Status\Sysprepstatus" /v GeneralizationState /t REG_DWORD /d 00000007 /F
reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v SkipRearm /t REG_DWORD /d 00000001
msdtc -uninstall
timeout 120
msdtc -install
timeout 120
rmdir /Q /S "C:\Windows\System32\Sysprep\Panther"
del /Q "C:\Windows\System32\Sysprep\Sysprep_succeeded.tag"

Finally I reboot -> sysprep OK.

Jose Balani said...

Nothing work