FacebookTwitterLinkedIn

FIX: The computer restarted unexpectedly or encountered an unexpected error

How to Fix "The computer restarted unexpectedly or encountered an unexpected error" Error

You may have experienced "The computer restarted unexpectedly or encountered an unexpected error." This message also states the following: 'Windows installation cannot proceed. To install Windows, click "OK" to restart the computer, and then restart the installation.'

the computer restarted unexpectedly

The computer restarts in some cases, but you still can't proceed with the installation. This frustrating error affects many users, but, fortunately, there are solutions.

The error usually occurs when users try to update or upgrade their current Windows operating system versions or use a recovery disk to restore Windows to its factory settings. In some cases, this creates an infinite restart loop.

A few possible fixes to the problem will allow you to exit the endless restart loop. To resolve "The computer restarted unexpectedly or encountered an unexpected error," you might need to edit the Windows registry using Command Prompt commands, run the Automatic Repair tool, format the hard drive, and take other actions.

Video Showing How to Fix "The computer restarted unexpectedly or encountered an unexpected error" Error:

Table of Contents:

Edit Windows Registry

Windows Registry is a collection of databases of configuration settings in Microsoft Windows operating systems. It stores much of the information and settings for software programs, hardware devices, user preferences, operating system configurations, and much more.

To fix the "The computer restarted unexpectedly or encountered an unexpected error" problem, you will need to change the ChildCompletion DWORD value data. To do so, press Shift + F10 keys on your keyboard. This should bring up the Command Prompt window. If this combination does not work, access Advanced Startup Options.

Read this guide and use the "Interrupt Windows Boot Process" method, or use the Windows Installation CD/DVD/USB to access Command Prompt. In Command Prompt, type "regedit" and press Enter. This will open Registry Editor.

edit windows registry step 1

Now follow this path: "HKEY_LOCAL_MACHINE/SYSTEM/Setup/Status/ChildCompletion". Select the "ChildCompletion" key and double-click "setup.exe" REG_DWORD, or right-click it and select "Modify..." from the contextual menu.

edit windows registry step 2

In the Edit DWORD (32-bit) Value window, set the value data to 3 and click "OK". Close the Registry Editor, restart your computer, and check if you still receive the "The computer restarted unexpectedly or encountered an unexpected error" error while trying to update, upgrade, or recover your Windows operating system.

edit windows registry step 3

[Back to Table of Contents]

Run Automatic/Startup Repair

Automatic/Startup Repair is a Windows diagnostics-based troubleshooting tool commonly used to repair the Windows operating system when an issue prevents startup. It is usually able to fix problems when there are damaged or missing system files. It might fix the "The computer restarted unexpectedly or encountered an unexpected error" issue, which prevents you from upgrading, recovering, or updating Windows.

To launch Automatic/Startup Repair, you must use the Windows Installation Media on your DVD/USB or interrupt the boot process. You can find instructions in the previous method. Once you are in the Advanced Startup Window, click "Troubleshoot".

run automatic/startup repair step 1

Then click "Advanced options".

run automatic/startup repair step 2

Now click the "Startup Repair" option. Windows will start to diagnose your computer. See if this fixes the "The computer restarted unexpectedly or encountered an unexpected error" error.

run automatic/startup repair step 3

[Back to Table of Contents]

Format Your Hard Drive

Disk formatting is the process that prepares your data storage device (in this case, the hard drive/HDD) for initial use. It is considered the best way to erase all information stored on a hard disk drive (or another drive) before installing a clean version of the Windows operating system.

If the two methods described above did not fix "The computer restarted unexpectedly or encountered an unexpected error", formatting your hard drive should do it. As mentioned before, however, this will erase everything from your hard drive.

To format your hard drive, open Command Prompt as described in previous methods. In Command Prompt, type these commands and press Enter after each:

Diskpart
list volume
select volume 1 (change '1' to the number assigned to the drive you want to format)
format fs=ntfs quick label=test (you can change "test" to any label)
exit

format your hard drive

When the formatting is complete, restart the computer and try to install Windows again. Nevertheless, we hope it was unnecessary to format your hard drive (a rather drastic measure) and that the first method worked to resolve the "The computer restarted unexpectedly or encountered an unexpected error" issue.

If you know of other solutions to this problem not mentioned in our guide, please share them with us by leaving a comment in the section below.

[Back to Top]

▼ Show Discussion

About the author:

Rimvydas Iliavicius

Rimvydas is a researcher with over four years of experience in the cybersecurity industry. He attended Kaunas University of Technology and graduated with a Master's degree in Translation and Localization of Technical texts. His interests in computers and technology led him to become a versatile author in the IT industry. At PCrisk, he's responsible for writing in-depth how-to articles for Microsoft Windows. Contact Rimvydas Iliavicius.

Our guides are free. However, if you want to support us you can send us a donation.

About PCrisk

PCrisk is a cyber security portal, informing Internet users about the latest digital threats. Our content is provided by security experts and professional malware researchers. Read more about us.

Read this article in other languages
Malware activity

Global malware activity level today:

Medium threat activity

Increased attack rate of infections detected within the last 24 hours.