Patch Error Troubleshooting
Summary
This script helps to reset all the Windows Update components. It performs actions such as:
- Stopping the Windows Update, BITS, CryptSvc, and AppIdSvc services.
- Removing
%ALLUSERSPROFILE%/Application Data/Microsoft/Network/Downloader/qmgr*.dat
- Removing
C:/Users/All Users/Microsoft/Network/Downloader/qmgr*.dat
- Renaming the SoftwareDistribution folder to SoftwareDistribution.bak
- Renaming the Catroot2 folder to Catroot2.bak
- Resetting all Windows Update DLLs
- Performing a Winsock reset
- Starting the Windows Update, BITS, CryptSvc, and AppIdSvc services.
Reboot the computer.
Time Saved by Automation: 20 Minutes
Sample Run
Target: Windows Device
Note: This script will forcefully reboot the target device. It may not be ideal to run this script during business hours.
Process
- Create a .BAT file in the
C:/temp/
folder, and the script will execute the .BAT file.- The .BAT file will stop and then start several services and delete or rename some files (View all actions below).
- Stop services: Windows Update, BITS, CryptSvc, and AppIdSvc.
- Delete
%ALLUSERSPROFILE%/Application Data/Microsoft/Network/Downloader/qmgr*.dat
- Delete
C:/Users/All Users/Microsoft/Network/Downloader/qmgr*.dat
- Rename the SoftwareDistribution folder to SoftwareDistribution.bak
- Rename the Catroot2 folder to Catroot2.bak
- Reset all Windows Update DLLs
- Perform a Winsock reset
- Start services: Windows Update, BITS, CryptSvc, and AppIdSvc.
- The .BAT file will stop and then start several services and delete or rename some files (View all actions below).
Output
Script logs