Windows Update reset script

There are quite a few times that Windows Update gets stuck with bizarre error codes. At first I tried Microsoft Windows Update Troubleshooter, but it did not help in most of the cases. . There are various sites that suggest a manual, long and tedious process to reset Windows Update, but better yet - there ...