The Computer Restarted Unexpectedly or Encountered an Unexpected Error: 5 Causes and 7 Fixes for Windows 10 and 11 Installation
- A definition of the error, with 4 situations where it appears
- 5 causes, from corrupted installation files to custom answer files
- A table of 4 error situations with the matching fix for each situation
- 7 fixes in order, from disconnecting devices to a clean installation
- The reason Windows Setup restarts at 64 percent
- A fix for sysprep generalized images
- An answer on file safety during the fixes
- 5 prevention measures
- 5 People Also Ask answers
What Does the Computer Restarted Unexpectedly or Encountered an Unexpected Error Mean?
The error means Windows Setup was interrupted or became corrupted and restarts the computer in a loop. HP Support describes the message as a sign that the installation never completed. The message tells the user to click OK, restart the computer, and restart the installation. Clicking OK and rerunning Setup returns the same error window.
The error appears in 4 situations:
- A clean installation of Windows
- A Windows build update
- A Reset this PC operation
- A reference image created with sysprep
The error occurs on Windows 10, Windows 11, earlier Windows versions, and Windows Server. Reset this PC and recovery images also lose their place in the installation process.
What Causes the Computer Restarted Unexpectedly or Encountered an Unexpected Error?
The error has 5 causes: corrupted installation files, a stalled setup status in the registry, drive problems, an outdated BIOS, and a custom answer file.
Can Corrupted Installation Files Cause the Error?
Yes. A corrupted or modified Windows installation image (install.esd or wim file) is the most common cause of the reboot loop at 64 percent. A corrupted registry and damaged Windows files also trigger the error.
Can a Stalled Setup Status in the Registry Cause the Error?
Yes. The setup.exe value under the ChildCompletion registry key is typically 1 when the error loops, and a value of 3 forces the installer to the next stage.
Can Drive Problems Cause the Error?
Yes. Hard drive cable problems and a damaged hard disk cause the loop. Desktops use data and power cables, and laptops use internal connectors.
Can an Outdated BIOS Cause the Error?
Yes. TechCult lists an outdated BIOS among the reasons for the error.
Can a Custom Answer File Cause the Error?
Yes. A generalized image that processes a custom Unattend.xml answer file fails during the initial boot. Microsoft documents this cause for Azure virtual machines.
Which Fix Matches Which Error Situation?
Match the fix to the situation: a looping error after clicking OK calls for the ChildCompletion registry change.
The table below lists 4 error situations, the likely cause of each situation, and the matching fix.
| Situation | Likely Cause | Matching Fix |
|---|---|---|
| The error returns after clicking OK | Stalled setup status in the registry | Change the ChildCompletion setup.exe value to 3 |
| The computer restarts before registry editing finishes | Automatic restart after a failure | Edit the offline registry hive |
| The installation loops at 64 percent | Corrupted or modified installation image | Recreate the installation media and run a clean installation |
| The error appears on a sysprep generalized image | Custom answer file | Run sysprep without the unattend flag |
Windows OS Hub documents the first 3 situations and their fixes. Microsoft documents the answer file situation.
How Do You Fix the Computer Restarted Unexpectedly or Encountered an Unexpected Error?
Fix the error with 7 steps in order: disconnect unused devices, change the registry value, edit the offline registry, run Startup Repair, check the drive, update the BIOS, and recreate the installation media.
1. How Do You Disconnect Unused Devices During Windows Setup?
Disconnect all unused USB drives, LAN adapters, and Wi-Fi adapters from the computer. Disconnect them physically or disable them in the BIOS or UEFI settings.
2. How Do You Change the ChildCompletion Registry Value?
Press Shift + F10 on the error screen, open Registry Editor, and change the setup.exe value from 1 to 3. Shift + F10 opens Command Prompt, and some laptops need Shift + Fn + F10.
- Press Shift + F10 on the error screen.
- Type regedit in Command Prompt and press Enter.
- Open HKEY_LOCAL_MACHINE\SYSTEM\Setup\Status\ChildCompletion.
- Double-click setup.exe and change the value to 3.
- Close Registry Editor and click OK on the error window.
HP Support Community documents the same change and states that the value forces the installer to proceed. The installation continues normally after the restart. Change only the setup.exe value.
3. How Do You Edit the Registry When the Computer Restarts Too Quickly?
Boot from Windows installation media and load the offline system registry hive. Windows restarts automatically after a system failure, which leaves no time to edit the live registry.
- Boot from Windows installation media and press Shift + F10 on the first screen.
- Run diskpart, then list vol, to find the Windows volume.
- Run assign letter=w: for the Windows volume, then exit.
- Run regedit, select HKEY_LOCAL_MACHINE, and choose File, then Load Hive.
- Open W:\Windows\System32\Config\System and name the hive mylocal.
- Change setup.exe to 3 under HKEY_LOCAL_MACHINE\mylocal\Setup\Status\ChildCompletion.
- Choose File, then Unload Hive, and restart the computer.
The volume letter varies by computer, and the drive letter W is an example.
4. How Do You Run Startup Repair?
Boot from the Windows installation media, select Repair your computer, choose Troubleshoot, open Advanced options, and select Startup Repair. Windows diagnoses the computer after this selection. Restart the computer afterward to check the result. Windows computer startup repair steps
5. How Do You Check the Drive and Cables?
Reseat the drive cables on a desktop and run chkdsk on the Windows volume. The command chkdsk W: /F /R checks the drive for errors, where W is the Windows volume letter. Cable problems between the drive and the motherboard also produce the loop. computer hard drive detection fixes
6. How Do You Update the BIOS?
Download the latest BIOS version from the computer manufacturer’s support site and install it with the manufacturer’s instructions. An outdated BIOS is a listed cause of the error.
7. How Do You Recreate the Installation Media and Run a Clean Installation?
Create new installation media with the Microsoft Media Creation Tool, then install Windows on unallocated space. Download MediaCreationTool.exe from the Microsoft download page and run it. The tool needs a blank USB flash drive with at least 8 GB of space. Microsoft recommends a blank drive because the process deletes all existing content.
Boot from the new USB drive, delete all partitions on the target drive, and install Windows on the unallocated space. The installer then creates all required system partitions. Back up files before installing or reinstalling Windows. Windows computer recovery options
Why Does Windows Setup Restart at 64 Percent?
Windows Setup restarts at 64 percent when the installation image is corrupted or modified. Official installation media from the Media Creation Tool or Rufus replaces the damaged image. Step 7 covers the full procedure.
How Do You Fix the Error on a Sysprep Generalized Image?
Prepare a new generalized image and run sysprep without the unattend flag. Microsoft’s guidance for Azure virtual machines uses this command:
sysprep /oobe /generalize /shutdown
Restoring the virtual machine from a recent backup is the alternative.
Does Fixing the Error Erase Files?
Registry edits and Startup Repair keep files, and deleting partitions for a clean installation erases the drive. Copy data from the drive before removing partitions. Formatting the hard drive erases everything on it.
How Do You Prevent the Error During Windows Installation?
Prevent the error by using official installation media, disconnecting unused devices, and keeping the BIOS current.
- Create installation media with the Microsoft Media Creation Tool
- Use a blank USB flash drive with at least 8 GB of space
- Disconnect unused USB drives and network adapters
- Back up files before installing
- Update the BIOS from the manufacturer’s support site
People Also Ask About the Computer Restarted Unexpectedly or Encountered an Unexpected Error
What is the ChildCompletion registry key?
ChildCompletion is the registry key where changing the setup.exe value from 1 to 3 forces the Windows Installer to proceed to the next installation stage.
How do you open Command Prompt during Windows Setup?
Press Shift + F10 on the error screen, or Shift + Fn + F10 on some laptops.
Does the error affect Windows 11?
Yes, the error affects Windows 10, Windows 11, earlier Windows versions, and Windows Server.
Can Startup Repair fix the error?
Yes, Startup Repair fixes the error in some cases, and a clean installation is the next step when it fails.
Why does the computer restart unexpectedly during Windows installation?
Windows Setup was interrupted or became corrupted, and the cause is corrupted files, a stalled registry status, drive problems, an outdated BIOS, or a custom answer file. HP Support, TechCult, and Microsoft describe these causes.
How was this computer guide checked?
The editorial check compares each Windows path, command and warning with official Microsoft documentation and the relevant computer maker’s support material. Model-specific steps point readers to the applicable manual. We do not claim a physical lab test unless the page names the hardware and result.
Documentation review date: 9 November 2026. Report a correction through the site’s editorial process.