Working on Windows 7 is beginning to feel like a trip down memory lane. Windows 8 and Windows 10 have some drastic interface differences that working on Windows 7 requires a little refocus. It’s not nearly as bad as working on a Windows XP or Vista box these days but it’s getting there.
I have most of my computers to Windows 10 or at least Windows 8.1. However, I found myself working on a Windows 7 computer last week. After replacing the fried power supply, I booted the computer up to find that it had been in the middle of Windows Updates. This led to the very frustrating “Failure configuring Windows Updates. Reverting changes… Do not turn off your computer.’ message.
I have seen this error message before. It usually begins with the computer hanging at 35% for applying updates before the restart and comes back up to the failure notice. This seems to result from Windows Updates having problems applying a patch because malware has changed the OS code enough. These previous instances were able to fix themselves when given enough time to revert changes. In this case, I gave it over 8 hours. The reverting changes message switched to shutting down and did not make any further progress in that time. After restarting the computer it returned to the reverting changes message.
I could get into the computer with Safe Mode but I was limited from most actions. I wanted to upgrade the computer to Windows 10 but I could not start the process in Safe Mode. I tried a variety of steps:
- Boot into Safe Mode and run Windows Update Troubleshooter
- Boot into Safe Mode and run System File Checker with sfc /scannow
- Boot into Safe Mode and run check disk with chkdsk /r
- Perform a clean boot (where all non-Microsoft services and startup items are disabled) using msconfig
- I cleaned up malware using Malwarebytes under Safe Mode
- I initiated a System Restore from Safe Mode to before the last Windows Updates were applied
The System Restore took a long time to run (overnight) and eventually failed out. When trying to run System Restore again, it said there were no available restore points.
I also ran system file checker and check disk from the Windows Installer repair tool when booting to a Windows 7 install DVD. Neither of these found any integrity violations or changed the situation.
I finally found one last suggestion, which was to remove the flag that said there were Windows updates to apply. This involves removing the pending.xml files under C:\Windows\winsxs. I did this by taking ownership of the files and changing permissions in command line to allow me to delete the files. Unfortunately, it did not change anything and booting into normal mode was still greeted by the ‘reverting change’ message.
A further note in the last suggestion used DISM.exe. The Deployment Image Servicing and Management tool can run on the live Windows session or a separate image. The note suggested running the ‘revertpendingactions’ parameter on the online image but this is not allowed.
Instead, I booted to the Windows Installer repair tool and ran the revert pending actions parameter against the separate drive with this command:
dism.exe /image:D:\ /cleanup-image /revertpendingactions
It processed through and removed pending tasks. Upon booting into Normal mode, it went through a brief process of configuring Windows Updates and after that it proceeded to login properly. I took the opportunity to back up the data and after seeing how corrupted everything was, I noted the Windows 7 product key and installed Windows 10 from scratch.
While I am encountering Windows 7 less and less, the use of DISM and the revertpendingactions was a good option that I did not know of before, which is why I am writing about it here.