Friday, August 4, 2017

"The unattend answer file contains an invalid product key" when trying to restore Windows 7




I'm trying to fix a friend's Windows 7 PC. I originally asked a question at



How to restore a Windows Vista PC to factory settings, when it has been upgraded to Windows 7



And got a useful answer from @Patrick R., which helped direct me towards the Windows 7 USB/DVD Download Tool. The friend who's PC I'm fixing couldn't remember his login for the Microsoft Store (where he thinks he bough his Windows 7 upgrade; he's relatively certain he bought it online, rather than buying a disk) so we borrowed a Windows 7 disk from another friend. But then my friend couldn't remember his Windows 7 product key, and because his PC isn't letting us run any programs we can't run something to tell us what the key is (I've read that we could physically remove the hard drive from the PC and then find the product key from another computer, but I'm trying to avoid that if possible).



Fortunately, thought, I found this:



http://www.intowindows.com/how-to-legally-reinstall-windows-7-without-product-key/




In short, it seems that you can tell Windows 7 to restore to factory settings from within control panel as long as you have a Windows 7 disk (which we now do), and that you won't need the product key (which is good, because we don't have that).



However, when I go through the steps listed in that link, I get the following error message:



"The unattend answer file contains an invalid product key. Either remove the invalid key or provide a valid product key in the unattend answer file to proceed with Windows installation."



Googling around that led me to this:



http://www.sevenforums.com/software/346150-unattend-answer-file-contains-invalid-product-key.html




That seems to suggest that it's possible to work around this error message by editing the unattend.xml file. But -- and here, finally, is my question -- where is the unattend.xml file?


Answer



As per my comments above, I couldn't locate the unattend.xml file. The other option would of course be to install Windows from scratch, but without the product key this isn't possible. Also, the computer I was trying to fix was able to boot into Windows, but it wasn't able to run any programs: so I wasn't able to use a product key extraction program.



So in the end I:




  1. Used SystemRescueCD (http://www.sysresccd.org/SystemRescueCd_Homepage) to boot up the PC, and access the contents of the harddrive

  2. Mounted an external harddrive, and copied the contents of C:\Windows\System32\config (i.e., the registry) to that harddrive


  3. Connected that harddrive to a working Windows 7 installation

  4. Used Enchanted Keyfinder (http://ekeyfinder.sourceforge.net/) to examine the registry backup for product keys, using the "Load Hive" option to load the registry backup from the external harddrive

  5. Booted the ailing PC from the Win7 installation DVD, ran the installer, and entered the product key I found in step 4 when requested



I was quite surprised that this worked, mainly because I was expecting complications to be caused by the original Win7 installation being an upgrade from Vista: but I can confirm that it worked, at least in this case. I'm wondering if the unattend.xml file (or what the pretty broken laptop was recognising as the unattend.xml file) was left over on the laptop from a Win7 installation that had been abandoned; I've read in various places online that this can be the case.


No comments:

Post a Comment

hard drive - Leaving bad sectors in unformatted partition?

Laptop was acting really weird, and copy and seek times were really slow, so I decided to scan the hard drive surface. I have a couple hundr...