Fix Windows Update Error 0x80242008 with PowerShell Script (Windows 11/10)
Fixing Windows Update Error 0x80242008 with PowerShell
Windows Update error 0x80242008 hits when downloads get cancelled or corrupted. It blocks updates until you reset the update components. Here’s a PowerShell script that fixes it fast.
The Problem
This error means the update handler stopped the operation. Common causes are bad cache in SoftwareDistribution folder or stalled services like BITS and wuauserv. Manual resets work but take time. PowerShell automates it all.
The Script
Run PowerShell as admin. Copy-paste this code. It stops services, clears folders, restarts everything.
powershell# Reset Windows Update components – run in elevated PowerShell
Write-Host "Stopping Windows Update related services..." -ForegroundColor Cyan
$services = 'wuauserv','bits','cryptSvc','msiserver'
foreach ($svc in $services) {
if (Get-Service -Name $svc -ErrorAction SilentlyContinue) {
try {
Stop-Service -Name $svc -Force -ErrorAction Stop
Write-Host "Stopped service: $svc"
} catch {
Write-Host "Failed to stop service: $svc - $($_.Exception.Message)" -ForegroundColor Yellow
}
}
}
Write-Host "Renaming SoftwareDistribution and catroot2..." -ForegroundColor Cyan
$sdPath = Join-Path $env:SystemRoot 'SoftwareDistribution'
$sdOld = Join-Path $env:SystemRoot 'SoftwareDistribution.old'
$crPath = Join-Path $env:SystemRoot 'System32\catroot2'
$crOld = Join-Path $env:SystemRoot 'System32\catroot2.old'
if (Test-Path $sdOld) { Remove-Item $sdOld -Recurse -Force -ErrorAction SilentlyContinue }
if (Test-Path $crOld) { Remove-Item $crOld -Recurse -Force -ErrorAction SilentlyContinue }
if (Test-Path $sdPath) { Rename-Item $sdPath -NewName 'SoftwareDistribution.old' -Force }
if (Test-Path $crPath) { Rename-Item $crPath -NewName 'catroot2.old' -Force }
Write-Host "Starting Windows Update related services..." -ForegroundColor Cyan
foreach ($svc in $services) {
if (Get-Service -Name $svc -ErrorAction SilentlyContinue) {
try {
Start-Service -Name $svc -ErrorAction Stop
Write-Host "Started service: $svc"
} catch {
Write-Host "Failed to start service: $svc - $($_.Exception.Message)" -ForegroundColor Yellow
}
}
}
Write-Host "Reset complete. Please reboot, then try Windows Update again." -ForegroundColor Green
How It Works
- Stops four key services: Windows Update, BITS, Cryptographic Services, Windows Installer.
- Renames SoftwareDistribution and catroot2 folders to .old (forces fresh cache).
- Restarts services safely with error checks.
- Color-coded output shows progress.
After Running
Reboot your PC. Open Settings > Windows Update. Hit Check for updates. The error should clear.[youtube]
Pro Tips for IT Admins
- Test on a VM first if managing enterprise systems.
- Add
Start-Transcript -Path C:\resetwu.logat top for logging. - For Azure AD joined devices, check Intune policies don’t block folder renames.
- Pair with
sfc /scannowif corruption lingers.
Why This Beats Manual Steps
Manual fixes need 10+ clicks across Services.msc and File Explorer. This script does it in seconds with feedback. Works on Windows 10/11, Server 2022 too.
Save this as Reset-WU.ps1. Pin to Start for quick access during support calls.
