26 January 2012

"The Computer Restarted unexpectedly or encountered an unexpected error" during sysprep

Posted By: Mick Pletcher - 10:20 AM

Share

& Comment

The error "The Computer Restarted unexpectedly or encountered an unexpected error" is an annoying error that completely stops the sysprep setup process. The system does not need to be rebuilt. The issue that caused it on one of the machines we encountered this on was due to the fact that some profiles had been deleted from the file structure, but the registry entries were left in tact. In order to fix this issue, you will need to change the registry key HKLM/SYSTEM/SETUP/STATUS/ChildCompletion Setup.exe from 1 to 3. This will allow the sysprep process to complete. The drivers will not be installed and likely, the system will not be joined to a domain, if applicable. The main thing is that the OS can now be booted up and logged into. Here is the contents of a reg file that will change it for you.

In order to get to the registry, when the above listed error appears, hit Shift-F10. This will bring up a command prompt window. Type regedit and then make the registry change. At that point, reboot the machine and it should boot up into Windows 7.

NOTE: This was performed on a Windows 7 64-bit machine. Per a reply to this blog, it was also confirmed to work on Windows Server 2008.

 Windows Registry Editor Version 5.00  
 [HKEY_LOCAL_MACHINE\SYSTEM\Setup\Status\ChildCompletion]  
 "setup.exe"=dword:00000003  

About Mick Pletcher

My blog is here to help solve issues I have encountered and solved, publish scripts I have written, and educate others in understanding areas that are not well covered

67 comments:

  1. We received the same error on one of our machines, but, in our case, it was due to bad memory.

    ReplyDelete
  2. This helped me in a virtual lab test environment. I sysprepped a computer that was on a domain and it does this sysprep loop when loading up. I will try this on the laptop with the issue on Monday.

    ReplyDelete
  3. Ahh, unfortunately the production laptop's orig hard drive got formatted when the tech used image software to "clone" to the new laptop. And the new laptop received a reinstall since I didn't think an answer existed because I could not find a solution 3 months ago. Oh well, I can, however, duplicate this problem by sysprepping a computer joined to the domain. Then I force restart while sysprep is setting up the registry on first boot. The VM would go into this loop.

    I found this article by searching "Computer Restarted unexpectedly sysprep". But it seems this solution applies to failed windows 7 installs too.

    Side note to others: Shift + f10 to open up command prompt and open regedit when you see this error message.

    ReplyDelete
  4. Hello. This advice solved my problem. Many thanks!

    ReplyDelete
  5. This has solved my problem with start up of a new laptop. Thanks a million!

    ReplyDelete
  6. Only solution on the net! but correct! Thank you a 1000-times!

    ReplyDelete
  7. Thank you for your post, I used your suggestion on Windows Server 2008 R2 and it worked.
    Kind Regards,
    Cristiano

    ReplyDelete
    Replies
    1. Thanks for confirming this works on Server 2008! I will update the blog to reflect this.

      Delete
  8. Funny enough, this is the second time I've fallen into this trap. Win7 setup, by default, disables the Administrator account, and has you set up another administrative account during first install. to keep things clean, and to take advantage of the bit of sysprep that copies the administrator account to the default account, I always remove this account, and use local administrator to set the machine up before pulling an image to deploy. Well, removing that dummy account causes the mini-setup to fail upon pulling and booting the image unless you do some registry cleanup that Win7 can't be arsed to do itself. This tip helped me save a re-install by getting me back into the install so I could re-sysprep it after I cleaned things up. Thanks!

    ReplyDelete
  9. Thanks for the solution

    ReplyDelete
  10. Thank you! After a week of searching the web and trying things that didn't work I finally stumbled upon this post and it WORKED!!!

    ReplyDelete
  11. Sooo thankful for this solution. Saved me today!

    ReplyDelete
  12. Nice one Mick, I've just spend a day or two creating a new custom image for my company and thought all my hard had gone to waste - but with your advice I can now get windows 7 to boot and can recify this problem and re-sysprep. Thanks

    ReplyDelete
  13. You have saved me 2 days work after a failed sysprep! Thank-you very much

    ReplyDelete
  14. Saved me 8 hours of image build time. Your my new hero.

    ReplyDelete
  15. i encountered the same error in vista and this works... thanks a lot dude

    ReplyDelete
  16. Thanks, thanks, thanks, thanks and thanks!!!!!!!!!!!!

    ReplyDelete
  17. You just saved me from rebuilding my sysprep'd image! Thank you!!

    ReplyDelete
  18. Thanks alot for this post, it worked a treat on a Sony laptop I have imaged.

    However, I decided to make this registry change in the image's registry hive directly, so we don't have to repeat this process everytime we use the image, and I get an error message coming back saying "Unable to make registry changes", and the install reverts all changes. Any suggestions?

    ReplyDelete
  19. Working for a company that sells computers/laptops i had a lot of machines with this problem and never could figure out what was causing it.
    Restoring/reinstalling was the only option but now finaly... Thanks for sharing the solution.

    ReplyDelete
  20. Thanks a lot brother...
    U saved a lot of time.. and just blew me into
    the safe zone... thanks a lot .

    ReplyDelete
  21. This solution works...!!!!
    Thanks a lot bro...Nice job...!!!

    ReplyDelete
  22. ah, sim o cara é foda manja mesmo, vlwww, deu certo aqui!!!!!

    ReplyDelete
  23. awsome worked great!!

    ReplyDelete
  24. It works! This was very helpful. Props to the author. Thanks a ton!

    ReplyDelete
  25. Thanks worked for me on Windows 7 :-)

    ReplyDelete
  26. Thanks worked for me as well.

    ReplyDelete
  27. After two days I finally got it to work without reinstalling my Windows Server 2008 SP2! You're my personal hero! Thank you very much! I love you!

    ReplyDelete
  28. After two days I finally got it to work without reinstalling my Windows Server 2008 SP2! You're my personal hero! Thank you very much! I love you!

    ReplyDelete
  29. add one more satisfied customer. Something had corrupted my current Windows 7 install and while trying to reinstall from the recovery DVDs I encountered that issue.
    Thank you very much!

    ReplyDelete
  30. Thanks for posting this! worked like a charm!

    ReplyDelete
  31. Thanks bro u do not know how much he helped me thaaaanx man

    ReplyDelete
  32. Thank you Mick, it worked for Vista too. I had the problem when I wanted a factory restore.

    ReplyDelete
  33. Thanks! Thanks! Thanks!

    ReplyDelete
  34. Hi.... im having the same error but cant find the path to change.... all my machine goes up to is setup .....theres no childcompletion in my path .....please help

    ReplyDelete
  35. If it is getting stuck at the setup, then I would mount the drive onto a working machine and then edit the registry from there. After editing the registry, put the HDD back into the system you were sysprepping it on and restart it. See if that corrects the issue.

    ReplyDelete
  36. You seem to have nailed the problem!
    Mick Pletcher you are a star!
    I was about to go nuts....now its installing and I am so far happy as a bee!
    Thank you very much!!!

    ReplyDelete
  37. Worked for me too on a new machined that I received with this issue on. After changing the registry to 3, as advised here, I restarted, and got a new error: WinSAT.exe - Bad Image. C:\windows\system32\NV\igdum64.dll is either not designed to use on windows or it contains an error. So I got worried and changed the registry back straight away and restarted the computer by holding the power button. It came back with the same error, so I immediately went back to the registry and it was still 3 (it did not get changed back to 1 after all). So I changed it to 1 again and clicked OK on the error box a few times now instead of shutting the laptop down. I was surprised when I saw that windows ran successfully! Please note that this time I had managed to change the registry back to 1, and it continues at 1 but works fine. Any ideas why this is? Thanks very much for the help!!!!

    ReplyDelete
  38. Thanks so much it worked!

    ReplyDelete
  39. Thanks, it works great!
    Vista ...

    ReplyDelete
  40. Omg thank you soo much I thought I lost my computer but you saved it thank you so much for saving my pc

    ReplyDelete
  41. Antivirus software (McAffee VirusScan) must be disabled or uninstalled before SYSPREP. Check antivirus log file.

    ReplyDelete
  42. Worked for installing Windows 8.

    Thank you!

    ReplyDelete
  43. i get error code 0xc0000001

    ReplyDelete
  44. Yup worked for W7 and W8

    ReplyDelete
  45. Windows Server 2008 R2 Enterprise.
    %insert thumbs up emoticon here%

    ReplyDelete
  46. Windows 7 Professional x86 (32-bits)
    THIS WORKS!!!!

    I sysprep my Windows OS from my MAC LAPTOP, and cloned it to a separate HDD
    First boot on a new (regular windows laptop), got BSOD 0x000007d, restarted and then sysprep failed. I then changed the value above and it finished the sysprep.

    ReplyDelete
  47. Thank you very very much... It worked on my Win 8 pro with media centre x64.....
    Thanks Again :D

    ReplyDelete
  48. Thank you! Your solution saved my prob with Windows7 Home Premium. However, you didn't explain the step after reboot. After starting the Windows successfully, I was prompted to a screen 'system preparation tool' hardware independence and clean up

    ReplyDelete
  49. thankx!!!
    this managed to solve my prob, for cloning my system with new m/b, cpu ..

    ReplyDelete
  50. Woo Hoo. This resoved the issues I had restoreing a customer's Ghost image to VM using ghost's deployanywhere to retarget the OS (to deal with the change of hardware) it got hung up at this step and the reg key worked :) thanks so much

    ReplyDelete
  51. SOLVED MY PROBLEM AFTER 5 MONTH..

    HUGE THANKS :D

    ReplyDelete
  52. Very informative and well written post! Quite interesting and nice topic chosen for the post.

    HP - Pavilion 17.3" Refurbished Laptop - 4GB Memory - 500GB Hard Drive - Sparkling Black

    ReplyDelete
  53. Thank you! Helped me meet a deadline! much appreciated!

    ReplyDelete
  54. Can confirm that this also works on Server 2012!
    Thankyou! Saved my day!!

    ReplyDelete
  55. I Love You
    THANK YOU , YOU SAVED ME!!

    ReplyDelete
  56. I got this error when i wanted to restore a system that i just syspred. The problem was that the system drive (boot drive) received the letter c and the windows drive received the drive h. Well i fixed it so that i edited the registry
    HKEY_LOCAL_MACHINE\SYSTEM\MountedDevices
    removed the drive C and renamed the windows drive c
    i also edited the
    [HKEY_LOCAL_MACHINE\SYSTEM\Setup\Status\ChildCompletion] setup key to 2 ;)

    ReplyDelete
  57. http://shubell.wordpress.com/2014/05/12/windows-vista-sysprep-multiple-partitions/

    ReplyDelete
  58. Hello. This advice solved my problem. Many thanks!

    ReplyDelete
  59. It also works on windows 2012 servers

    ReplyDelete
  60. This also helped me with a Windows 2012 R2 server in place upgrade. Thank you SO much for this post!

    ReplyDelete
  61. This helped me with a very stressful stage, thank you!

    ReplyDelete
  62. You are the best. Thank you sooooooo much. AHHHHHHHH

    ReplyDelete
  63. Get this same error, but the solution does not work for me, as I only have this in the reg settings: HKEY_LOCAL_MACHINE\SYSTEM\Setup Do not have the status folder... Any ideas.

    ReplyDelete

Copyright © 2013 Mick's IT Blogs™ is a registered trademark.