Unable to update Windows 10 programatically

I haven't tried using the script you are using to do Windows updates automatically. Previously (back when I had a job that required me to do things like that), I used the WSUS offline tool available here. That works like a charm for Windows 7 and others (haven't tried with Windows 10 but I imagine it will be fine). Basically, the tool lets you download all updates available for the OSes it supports. It then generates an update script that can be run on all the machines you want. It is community supported and there are quite a few people that submit fixes and improvements, making it a very solid tool.

I don't know if you are able to change tracks at this point and try out this tool but I can definitely recommend it for tasks like the one you are trying to accomplish.

Hope it helps :-)


It's possible that the actual update is causing issues for you.

Assuming that the script works good for you(which it seems like it does since the other updates applied) I would look at trying to purge the download. See the following link for more info:

https://superuser.com/questions/1000529/upgrade-to-windows-10-pro-version-1511-10586-errors-with-0x8024200d