Fix Windows Update Problems with PowerShell Script

Many people just install an antivirus software in their computers and think that it is all they need for complete protection from all the threats. While a good antivirus is an essential step towards securing your PC, it is just one of the many steps. You should also keep all the installed software and the Windows operating system itself updated. Installing the updates as soon as they are available ensures that known vulnerabilities are patched. While Windows can download and install the updates automatically, sometimes due to some configuration problems it fails to install the updates.

But now using a PowerShell script, you can fix the services and settings that could be causing the problem leading to a failure of automatic Windows updates. Here is how:

  1. Download the Reset-WindowsUpdate script from https://gallery.technet.microsoft.com/scriptcenter/Reset-WindowsUpdateps1-e0c5eb78.
  2. Download the Microsoft updates Windows8-RT-KB2937636-x64 and Windows8-RT-KB2937636-x86 from https://www.microsoft.com/en-US/download/details.aspx?id=43434 and https://www.microsoft.com/en-US/download/details.aspx?id=43433 respectively.
  3. Place all the downloaded files in the same folder.Reset Windows Update
  4. If you want to edit the script so that it can automatically reboot Windows after fixing up and cleaning up the settings, then open the Reset-WindowsUpdate.ps1 file in Notepad or Notepad++. And append these lines to the script and then save the script file:
    Write-Host “Process complete. Rebooting in 60 seconds…”
    shutdown /r /t 60

    Reset Windows Update

  5. In the folder where all the files are placed, click on File and select Open Windows PowerShell → Open Windows PowerShell as administrator.Reset Windows Update
  6. Give the following commands in the PowerShell window:
    Set-ExecutionPolicy Unrestricted
    ./Reset-WindowsUpdate.ps1
  7. After rebooting Windows, you have to change the execution policy for PowerShell scripts back to default by giving this command in the PowerShell (running as administrator) window:
    Set-ExecutionPolicy Default

Hopefully, this will take care of all of your Windows updates related troubles. The supplied PowerShell script cleans up the update catalog, downloaded update files, update logs and so on. Perhaps Windows will download a lot of data when your PC reboots and Windows tries to update, but it will be faster from then on.

One thought on “Fix Windows Update Problems with PowerShell Script

Leave a Reply

Your email address will not be published. Required fields are marked *