Windows Could Not Finish Configuring the System

I was blissfully updating my Windows 7 x64 image and then sysprepped it.  Brought it back up on bare metal and then encountered the dreaded “Windows could not Finish Configuring the System” error message.  I only ran some Microsoft updates and installed updates for Adobe Flash and VLC…not exactly image breaking stuff and programs I have updated many times before.  Now it is the year 2013 and you would think that Microsoft would have developed a bit more graceful way of telling me what the problem is from this screen instead of making me dive into log files in C:windowspanther.

After some searching , I found these steps posted by Jeff Harrsion over at http://social.technet.microsoft.com/Forums/windows/en-US/658528ce-6eb5-403b-ae41-458147c2c044/sysprep-failling-after-reboot-into-oobe.  They have been posted here:

1.) Push Shift+F10 to get to a command prompt
2.) Navigate to C:windowsPanther
3.) Find the Setup.etl file and find a way to copy this file off of the system (I copied it to the D: partition and used Ghost to gather that partition and get the file off)
4.) Copy the setup.etl file from the corrupted system to another computer that has Windows 7. Put it on the root of C: for easiest access.
5.) Open a Command Prompt on the Windows 7 computer.
6.) Navigate to the root of C: (or wherever you saved the file)
7.) Type “tracerpt setup.etl -o logfile.csv”
8.) Close the command prompt and open up logfile.csv in your text editor of choice.
9.) Look through the log file (towards the end probably) for messages that say “Failed to process reg key or one of it’s decendants” For me, the exact eror looked like this: “Failed to process reg key or one of its descendants: [REGISTRY\MACHINE\SOFTWARE\ESET\ESET Security\CurrentVersion\Plugins\1000200\Profiles@My profile]” If you search for “reg key” or “failed to process” you should find the failure.

Surprisingly, the problem was the same exact problem I was having!  ESET includes something called Self Defense that “protects” its registry keys from modification.  Sysprep tries to modify these keys in some way, fails to do so and then dies.  Turning off the Self Defense feature in ESET and then running sysprep fixes the problem.

Of course, Self Defense is a nice feature to thwart viruses, so you can turn it back on after sysprep in 2 ways.  First is just to push down a REG file and then import it with regedit /s:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\ESET\ESET SecurityCurrentVersionPlugins1000600Profiles@My profile]
"SelfdefenceEnabled"=dword:00000001

Or just add a custom run command in the MDT task sequencer with this command line:

REG ADD "HKLM\SOFTWARE\ESET\ESET SecurityCurrentVersionPlugins1000600Profiles@My profile" /v SelfdefenceEnabled /t REG_DWORD /d 0x1 /f

Upon the first reboot, Self Defense will be turned back on.  Self Defense had been turned on for years and I’m not sure why it is causing a problem now, but it is!

– Soli Deo Gloria