Error code 0x80240031 – Solved?

(Like many of my technology postings, this is really here for my own notes on problems I run into, the solutions I try and what works when. They are updated as I learn.)

10.30.17  Unable to Update Windows 10.  There seems to be a whole laundry list of these errors codes for the Windows Update.  

I first tried:

  1. Search for msconfig in your Start search box
  2. In the search result window select System Configuration
  3. Once in the System Configuration dialog box, go to the Services tab and select Hide all Microsoft services. Then click Disable all
  4. In the same System Configuration dialog go to the Startup tab and click Open Task Manager
  5. Disable every startup item in the Task Manager
  6. Close the Task Manager and click OK
  7. Restart the computer. Re-run updates. 

Nope.  It downloads the updates and then gives me the same error while attempting to install them. 

Downloaded Windows Update Troubleshooter and found out the "Service registration is missing or corrupt". So I:

a. Press Windows key + R, type "services.msc" (without quotes) in start run box and press Enter

b. Locate Windows Update service.

c. Right click on the Windows Update service and select Properties.

d. In Start-up type, select Automatic from the list.

e. Click Start under Service status.

f. Click OK.

g. Repeat the steps c to f for the following services also:

Background Intelligent Transfer Service & Cryptographic Service.

Again, problems installing the updates. 

So I tried:

a) Press Windows key + X and select Command Prompt (Admin).
   
b) On the open Command Prompt window copy and paste the commands (all at once) 
 
net stop wuauserv

net stop cryptSvc
 
net stop bits

net stop msiserver

ren C:\Windows\SoftwareDistribution SoftwareDistribution.old

ren C:\Windows\System32\catroot2 catroot2.old

net start wuauserv

net start cryptSvc

net start bits

net start msiserver

This at least got us a new error code 0x80d02005. 

So I ran Windows Update again, left the computer on overnight and lo and behold, the big security update went through the next morning.  Took 4 hours.