A Fatal Error Occurred While Trying to Sysprep the Machine [Fix]

Repair the corrupt system files and Windows image

by Tashreef Shareef
Tashreef Shareef
Tashreef Shareef
Windows & Software Expert
Tashreef Shareef is a software developer turned tech writer. He discovered his interest in technology after reading a tech magazine accidentally. Now he writes about everything tech from... read more
Affiliate Disclosure
  • A fatal error while trying to sysprep the machine is common and affects all iterations of Windows.
  • In most cases, it's the corrupt system files or the Windows image to blame.
  • To fix things, modify the Registry or reinstall MSDTC, amongst other solutions.
fix a fatal error occurred while trying to sysprep the machine

The System Preparation tool is an essential part of the Windows OS and helps in duplicating, testing, and delivering new installations. However, while running it, you may encounter A fatal error occurred while trying to sysprep the machine.

This error occurs if the Windows Software Licensing Rearm program has run more than three-time in a single Windows image. Keep reading to find out the solutions!

How do I fix Sysprep’s fatal error?

1. Edit SkipRearm Key

  1. Press Windows + R to open Run, type regedit, and click OK.
  2. In the Windows Registry Editor, navigate to the following location:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform
  3. On the right pane, locate the SkipRearm key.path
  4. Double-click on the SkipRear, and in the Value data field, enter 1, then click OK.
  5. Close the Registry Editor and check if the error is resolved.

By editing the SkipRearam key, you can fix the Sysprep fatal error issue in Windows. Make sure you create a restore point before editing any registry keys.

2. Edit GeneralizationState and CleanupState keys

  1. Open the Registry Editor, and navigate to the following location:HKEY_LOCAL_MACHINE\SYSTEM\Setup\Status\SysprepStatus
  2. In the right pane, locate and double-click on the GeneralizationState key.GeneralizationState to fix GeneraliazationState
  3. In the Value data field, enter 7, and click OK.
  4. Next, locate and double-click the CleanupState key. If you can’t find it, save the changes and restart the PC.
  5. For those who did find the DWORD, enter 2 in the Value data field and click OK.
  6. Run System Preparation Tool and check for any improvements.

Editing GenealizationState and CleanupState DWORDs can help fix things if you see A fatal error occurred while trying to sysprep the machine when running sysprep /generalize.

3. Run the DISM commands

  1. Press the Windows key, type cmd, right-click on Command Prompt, and select Run as Administrator.
  2. Click Yes in the UAC prompt.
  3. In the command prompt, paste the following commands and hit Enter after each:
    DISM /Online /Cleanup-Image /CheckHealth DISM /Online /Cleanup-Image /RestoreHealthdism commands
  4. The process may take a few minutes to complete.
  5. Upon completion, it will display a success message.
  6. Close the command prompt and run the System Preparation Tool.

The DISM commands help repair the system image and can fix things when you receive errors while running the System Preparation Tool. You can also go for a specialized tool to simplify this process.

4. Uninstall MSDTC

  1. Press Windows + R to open Run, type cmd, and hit Ctrl + Shift + Enter.
  2. Type the following command and hit Enter to uninstall the server:msdtc -uninstall
  3. To reinstall the service, run the following command:msdtc -installreinstall msdtc
  4. Run the System Preparation Tool and check for improvements.

That’s all! With these quick solutions, you should be able to fix A fatal error occurred while trying to sysprep the machine in Windows 7 and Windows 10.

Before you leave, find out how to use Sysrep in Windows, the various commands, and actions.

Don’t forget to leave any other questions or suggestions that you may have in the comments section below.

This article covers:Topics: