Fix The Computer Restarted Unexpectedly or Encountered an Unexpected Error

Sometimes Windows installation or upgrade can stuck in the endless reboot loop related to the following error: "The computer restarted unexpectedly or encountered an unexpected error. Windows installation cannot proceed. To install Windows, click "OK" to restart the computer, and then restart the installation."

This problem can be easily fixed by changing registry value HKEY_LOCAL_MACHINE\SYSTEM\Setup\Status\ChildCompletion\setup.exe from 1 to 3. Emergency Boot Kit will be of great help in this case, because it can edit Registry outside of Windows, even if Windows doesn't boot.

Contents

1. Symptoms of the problem

It looks like this in Windows 7:

The Computer Restarted Unexpectedly or Encountered an Unexpected Error - Windows 7
The Computer Restarted Unexpectedly or Encountered an Unexpected Error - Windows 7

In Windows 10/11:

The Computer Restarted Unexpectedly or Encountered an Unexpected Error - Windows 10/11
The Computer Restarted Unexpectedly or Encountered an Unexpected Error - Windows 10/11

This error is usually caused by unscheduled reboot on the final stage of Windows installation process, or a corrupt registry hive during Windows upgrade process.

2. Solution in a nutshell

  1. Download Emergency Boot Kit and deploy it to the USB thumbdrive.
  2. Boot Emergency Boot Kit and run Registry Editor tool from the main menu.
  3. Choose Windows installation and HKEY_LOCAL_MACHINE\SYSTEM registry hive.
  4. Navigate to Setup\Status\ChildCompletion Registry key
  5. Change registry value setup.exe from 1 to 3.
  6. Save updated registry hive to disk and reboot.

3. Step by step guide

1) Boot Emergency Boot Kit:

Fix Computer Restarted Unexpectedly - Boot Emergency Boot Kit
Fix Computer Restarted Unexpectedly - Boot Emergency Boot Kit

2) Choose Registry Editor in the main menu:

Fix Computer Restarted Unexpectedly - Choose Registry Editor
Fix Computer Restarted Unexpectedly - Choose Registry Editor

3) Choose Windows installation to edit Registry for (Windows 7 in this example):

Fix Computer Restarted Unexpectedly - Choose Windows Installation
Fix Computer Restarted Unexpectedly - Choose Windows Installation

4) Choose HKEY_LOCAL_MACHINE\SYSTEM registry hive:

Fix Computer Restarted Unexpectedly - Choose HKEY_LOCAL_MACHINE\SYSTEM Registry Hive
Fix Computer Restarted Unexpectedly - Choose HKEY_LOCAL_MACHINE\SYSTEM Registry Hive

5) Navigate to Setup Registry key (on the left panel). Then double-click it or press Enter on the keyboard:

Fix Computer Restarted Unexpectedly - Navigate to Setup Registry Key
Fix Computer Restarted Unexpectedly - Navigate to Setup Registry Key

6) Navigate to Status Registry key:

Fix Computer Restarted Unexpectedly - Navigate to Status Registry Key
Fix Computer Restarted Unexpectedly - Navigate to Status Registry Key

7) Navigate to ChildCompletion Registry key:

Fix Computer Restarted Unexpectedly - Navigate to ChildCompletion Registry Key
Fix Computer Restarted Unexpectedly - Navigate to ChildCompletion Registry Key

8) Press Tab key on keyboard to switch input focus to the right panel:

Fix Computer Restarted Unexpectedly - Switch input focus to the right panel
Fix Computer Restarted Unexpectedly - Switch input focus to the right panel

9) Using arrow keys on the keyboard, navigate to value with name setup.exe:

Fix Computer Restarted Unexpectedly - Navigate to value with name setup.exe
Fix Computer Restarted Unexpectedly - Navigate to value with name setup.exe

10) Change value data from 1 to 3:

Fix Computer Restarted Unexpectedly - Change value data from 1 to 3
Fix Computer Restarted Unexpectedly - Change value data from 1 to 3

11) Press F2 on keyboard to save registry hive to disk:

Fix Computer Restarted Unexpectedly - Save Registry hive to disk
Fix Computer Restarted Unexpectedly - Save Registry hive to disk

12) Press F10 to exit Emergency Boot Kit Registry Editor:

Fix Computer Restarted Unexpectedly - Exit the Emergency Boot Kit Registry Editor
Fix Computer Restarted Unexpectedly - Exit the Emergency Boot Kit Registry Editor

13) Choose Reboot in the main menu:

Fix Computer Restarted Unexpectedly - Done
Fix Computer Restarted Unexpectedly - Done