Update Scripts/Powershell/General Purpose/Fix Corrupted Windows Updates.md
All checks were successful
GitOps Automatic Deployment / GitOps Automatic Deployment (push) Successful in 7s

This commit is contained in:
2025-09-23 19:36:31 -06:00
parent 82076ff54f
commit 03cb5c1009

View File

@@ -2,24 +2,24 @@
Sometimes when you try to run Windows Updates, you may run into issues where updates just fail to install for seemingly nebulous reasons. You can run the following commands (in order) to try to resolve the issue. Sometimes when you try to run Windows Updates, you may run into issues where updates just fail to install for seemingly nebulous reasons. You can run the following commands (in order) to try to resolve the issue.
```powershell ```powershell
# Imaging Integrity Repair Tools # Imaging integrity Rrepair tools
DISM /Online /Cleanup-Image /RestoreHealth DISM /Online /Cleanup-Image /RestoreHealth
DISM /Online /Cleanup-Image /StartComponentCleanup DISM /Online /Cleanup-Image /StartComponentCleanup
sfc /scannow sfc /scannow
# Stop all Windows Update Services (In Order) to Unlock Underlying folders. # Stop all Windows Update services (in order) to unlock underlying files and folders.
net stop usosvc net stop usosvc
net stop wuauserv net stop wuauserv
net stop bits net stop bits
net stop cryptsvc net stop cryptsvc
# Purge the Windows Update Cache Folders and Recreate Them # Purge the Windows Update cache folders and recreate them
rd /s /q %windir%\SoftwareDistribution rd /s /q %windir%\SoftwareDistribution
rd /s /q %windir%\System32\catroot2 rd /s /q %windir%\System32\catroot2
mkdir %windir%\SoftwareDistribution mkdir %windir%\SoftwareDistribution
mkdir %windir%\System32\catroot2 mkdir %windir%\System32\catroot2
# Start all Windows Update Servers (In Order) # Start all Windows Update services (in order)
net start cryptsvc net start cryptsvc
net start bits net start bits
net start wuauserv net start wuauserv