-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows Update not working again #3214
Comments
Did you try resetting Updates to default ? If that didn't work, try running this script to fix Windows Update.
|
Tried Winutil>Default Settings already to no avail (it did say "Warnings occurred for some attributes during this operation. It's okay to ignore the warning") and after peeking in the log file it seems to want to reset services that are not installed, i.e: Error 1060: The specified service does not exist as an installed service. I also tried Winutil > Config > Reset Windows Update And sorry, not technically competent enough to know how/where to run that script you provided. Can you assist? |
It looks like a PowerShell script (the same filetype as winutil) Just name it with the |
Script hangs at "Executing: net stop cryptSvc" and doesn't continue Also had a lot of erors before that such as "Group Policy Client (gpsvc)' cannot be configured due to the following error: Access is denied" |
You'll most likely need to run PowerShell as an admin. Open PowerShell as admin and simply type the location of the script
|
Yes, I did. I ran it as admin via a shortcut |
Try this one?
|
Now it is running (I wonder if there is a difference to running it from a shortcut vs in powershell directly?) |
I'm starting to think it might not be related to MicroWin but some sort of error related to my specific system. As one Windows Update did manage to get through, it's only one that does not install (KB5051987). I decided to check in the Update history and noticed that there was a successful installation of another update. |
I dont think so because its not working for me |
After analyzing the issue thread and the code, here's a comprehensive solution for the Windows Update issues: Current Situation
Root Cause AnalysisThe error
The fact that some updates work while SolutionHere's a refined approach that takes into account the MicroWin environment and specifically targets
<#
.SYNOPSIS
Targeted Fix for KB5051987 Installation Issues
.DESCRIPTION
Specifically addresses error 0x800f081f while preserving MicroWin optimizations
Author: Nigel1992
#>
function Write-Log {
param(
[string]$Message,
[string]$Type = "INFO"
)
$timestamp = Get-Date -Format 'yyyy-MM-dd HH:mm:ss'
$color = switch ($Type) {
"ERROR" { "Red" }
"WARNING" { "Yellow" }
"SUCCESS" { "Green" }
default { "White" }
}
Write-Host "[$timestamp] $Type : $Message" -ForegroundColor $color
}
# Only check for essential services that we know exist in MicroWin
$essentialServices = @(
'wuauserv', # Windows Update
'bits', # Background Intelligence
'cryptsvc' # Cryptographic Services
)
try {
Write-Log "Starting targeted Windows Update repair for KB5051987..."
# 1. Clear pending updates that might be stuck
Write-Log "Clearing pending updates..."
if (Test-Path "$env:SystemRoot\SoftwareDistribution\Download") {
Remove-Item "$env:SystemRoot\SoftwareDistribution\Download\*" -Recurse -Force -ErrorAction SilentlyContinue
}
# 2. Reset only essential services
foreach ($service in $essentialServices) {
Write-Log "Processing $service..."
try {
Stop-Service -Name $service -Force -ErrorAction SilentlyContinue
Set-Service -Name $service -StartupType Automatic -ErrorAction SilentlyContinue
Start-Service -Name $service -ErrorAction SilentlyContinue
Write-Log "Successfully reset $service" "SUCCESS"
}
catch {
Write-Log "Warning: Issue with $service - continuing anyway" "WARNING"
}
}
# 3. Clear CBS log which can sometimes cause issues
if (Test-Path "$env:SystemRoot\Logs\CBS\CBS.log") {
Remove-Item "$env:SystemRoot\Logs\CBS\CBS.log" -Force -ErrorAction SilentlyContinue
}
# 4. Run DISM with progress reporting
Write-Log "Running DISM repair (this might take a while)..."
$dismProcess = Start-Process -FilePath "DISM.exe" -ArgumentList "/Online /Cleanup-Image /RestoreHealth" -NoNewWindow -PassThru -Wait
if ($dismProcess.ExitCode -eq 0) {
Write-Log "DISM repair completed successfully" "SUCCESS"
}
# 5. Reset Windows Update components
Write-Log "Resetting Windows Update components..."
$commands = @(
"wuauclt /resetauthorization /detectnow",
"UsoClient.exe RefreshSettings"
)
foreach ($cmd in $commands) {
try {
Invoke-Expression $cmd -ErrorAction SilentlyContinue
Write-Log "Successfully executed: $cmd" "SUCCESS"
}
catch {
Write-Log "Warning: Could not execute $cmd - continuing anyway" "WARNING"
}
}
Write-Log "Repair process completed" "SUCCESS"
Write-Log "Please try installing KB5051987 again" "INFO"
$restart = Read-Host "Would you like to restart now? (y/n)"
if ($restart -eq 'y') {
Restart-Computer -Force
}
}
catch {
Write-Log "Error occurred: $($_.Exception.Message)" "ERROR"
} How to Use the Script
Set-ExecutionPolicy Bypass -Scope Process -Force
.\fix_kb5051987.ps1 Important Notes
PreventionTo avoid similar issues in future MicroWin installations:
Let me know if you need any clarification or if the issue persists after trying these solutions. Also, please share your Windows build number if the problem continues - it might help us identify any version-specific issues. Note: Remember to run PowerShell as Administrator when executing these commands. The script has been designed to be as safe as possible while maintaining MicroWin's optimizations. |
Thank you. I did all that, to no avail. While googling about I think I recall reading that the update KB 5051987 corresponds to the same build. But I'm not sure how good that source was. And if I did have the update already as part of the build number I would assume that it would vanish in windows update and go away on it's on? |
I am having what appears to be the same problem with this update (2025-02 Cumulative Update for Windows 11 Version 24H2 for x64-based Systems (KB5051987)). Ran the script as described and am still receiving the update error:
Manually downloaded the cumulative update and found 2 separate msu files.
Not entirely convinced this is a winutil problem. Windows could do this on it's own. |
@cars11 I've created an enhanced Windows Update repair script specifically targeting build 26100 and the KB5051987 update issues. This script includes more robust error handling, service management, and system checks. # Fix Windows Update for Build 26100
# Author: Nigel1992
# Version: 1.0.0
# Last Modified: March 2025
#Requires -RunAsAdministrator
[CmdletBinding()]
param()
function Write-LogMessage {
param(
[Parameter(Mandatory = $true)]
[string]$Message,
[Parameter(Mandatory = $false)]
[ValidateSet('INFO', 'WARNING', 'ERROR', 'SUCCESS')]
[string]$Type = 'INFO'
)
$timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss"
$color = switch ($Type) {
"ERROR" { "Red" }
"WARNING" { "Yellow" }
"SUCCESS" { "Green" }
default { "White" }
}
Write-Host "[$timestamp] $Type : $Message" -ForegroundColor $color
}
function Test-PendingReboot {
$pendingRebootTests = @(
@{
Name = 'RebootPending'
Path = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\'
Property = 'RebootPending'
},
@{
Name = 'RebootRequired'
Path = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\'
Property = 'RebootRequired'
},
@{
Name = 'PendingFileRenameOperations'
Path = 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\'
Property = 'PendingFileRenameOperations'
}
)
$pending = $false
foreach ($test in $pendingRebootTests) {
if (Test-Path $test.Path) {
$value = Get-ItemProperty -Path $test.Path -Name $test.Property -ErrorAction SilentlyContinue
if ($value -ne $null) {
$pending = $true
break
}
}
}
return $pending
}
function Reset-WindowsUpdateComponents {
Write-LogMessage "Starting Windows Update components reset..." -Type INFO
$services = @(
'wuauserv', # Windows Update
'bits', # Background Intelligence Transfer
'cryptsvc', # Cryptographic Services
'trustedinstaller', # Windows Modules Installer
'UsoSvc' # Update Orchestrator Service
)
try {
# 1. Stop services
foreach ($service in $services) {
Stop-Service -Name $service -Force -ErrorAction SilentlyContinue
Write-LogMessage "Stopped service: $service" -Type INFO
}
# 2. Clear software distribution folders
$paths = @(
"$env:SystemRoot\SoftwareDistribution",
"$env:SystemRoot\System32\catroot2"
)
foreach ($path in $paths) {
if (Test-Path $path) {
$backupPath = "$path.old"
if (Test-Path $backupPath) {
Remove-Item $backupPath -Recurse -Force
}
Rename-Item $path "$path.old" -Force
Write-LogMessage "Renamed $path to $path.old" -Type SUCCESS
}
}
# 3. Reset Windows Update policies
Write-LogMessage "Resetting Windows Update policies..." -Type INFO
$regPaths = @(
"HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate",
"HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate",
"HKLM:\SYSTEM\CurrentControlSet\Services\wuauserv"
)
foreach ($regPath in $regPaths) {
if (Test-Path $regPath) {
$null = New-ItemProperty -Path $regPath -Name "WUServer" -Value "" -PropertyType String -Force -ErrorAction SilentlyContinue
$null = New-ItemProperty -Path $regPath -Name "WUStatusServer" -Value "" -PropertyType String -Force -ErrorAction SilentlyContinue
}
}
# 4. Reset Windows Update service security descriptors
Write-LogMessage "Resetting service security descriptors..." -Type INFO
Start-Process "sc.exe" -ArgumentList "sdset wuauserv D:(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRC;;;AU)(A;;CCLCSWRPWPDTLOCRRC;;;PU)" -Wait -NoNewWindow
# 5. Reset Windows Update catalog
Write-LogMessage "Resetting Windows Update catalog..." -Type INFO
Start-Process "cmd.exe" -ArgumentList "/c echo y | regsvr32 /s %windir%\system32\catroot2\*.*" -Wait -NoNewWindow
# 6. Restart services
foreach ($service in $services) {
Set-Service -Name $service -StartupType Automatic -ErrorAction SilentlyContinue
Start-Service -Name $service -ErrorAction SilentlyContinue
Write-LogMessage "Started service: $service" -Type SUCCESS
}
# 7. Run DISM and SFC
Write-LogMessage "Running system health checks..." -Type INFO
Start-Process "DISM.exe" -ArgumentList "/Online /Cleanup-Image /RestoreHealth" -Wait -NoNewWindow
Start-Process "sfc.exe" -ArgumentList "/scannow" -Wait -NoNewWindow
# 8. Force Windows Update detection
Write-LogMessage "Forcing Windows Update detection..." -Type INFO
wuauclt /resetauthorization /detectnow
(New-Object -ComObject Microsoft.Update.AutoUpdate).DetectNow()
Write-LogMessage "Windows Update components reset completed successfully" -Type SUCCESS
}
catch {
Write-LogMessage "Error during reset: $($_.Exception.Message)" -Type ERROR
return $false
}
return $true
}
# Main execution
Write-LogMessage "Starting Windows Update repair for Build 26100..." -Type INFO
# Check if running as admin
if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
Write-LogMessage "This script requires administrative privileges. Please run as Administrator." -Type ERROR
exit 1
}
# Check Windows build
$buildInfo = Get-ComputerInfo | Select-Object WindowsVersion, OsBuildNumber
if ($buildInfo.OsBuildNumber -ne 26100) {
Write-LogMessage "Warning: This script is optimized for Build 26100. Current build: $($buildInfo.OsBuildNumber)" -Type WARNING
}
# Check for pending reboots
if (Test-PendingReboot) {
Write-LogMessage "System has pending reboot. Please restart your computer before running this script." -Type WARNING
$restart = Read-Host "Would you like to restart now? (y/n)"
if ($restart -eq 'y') {
Restart-Computer -Force
}
exit 1
}
# Perform the reset
$success = Reset-WindowsUpdateComponents
if ($success) {
Write-LogMessage "Repair process completed. Please try Windows Update again." -Type SUCCESS
Write-LogMessage "If issues persist, please try the following:" -Type INFO
Write-LogMessage "1. Download updates manually from Microsoft Update Catalog" -Type INFO
Write-LogMessage "2. Check for any third-party antivirus interference" -Type INFO
Write-LogMessage "3. Ensure all Windows Update related services are running" -Type INFO
$restart = Read-Host "Would you like to restart now? (y/n)"
if ($restart -eq 'y') {
Restart-Computer -Force
}
} else {
Write-LogMessage "Repair process encountered errors. Please check the logs above." -Type ERROR
} How to use:
Key improvements:
Let me know if you encounter any issues or need further assistance! |
Ran the above install/repair script and unfortunately am not able to resolve the issue. Windows Update still shows Install error 0x800f081f. |
After analyzing the issue thread and the error patterns, I've created a specialized fix for Windows Update issues in MicroWin environments, particularly targeting KB5051987 on Build 26100. Analysis
New SolutionI've created a MicroWin-specific Windows Update repair script that takes into account the unique environment: MicroWin Update Fix Script (Click to expand)<#
.SYNOPSIS
MicroWin-Specific Windows Update Fix for KB5051987
.DESCRIPTION
Targeted fix for Windows Update issues in MicroWin environments
Specifically addresses KB5051987 on Build 26100
Author: Nigel1992
Version: 2.0.0
#>
function Write-LogMessage {
param(
[string]$Message,
[ValidateSet('INFO', 'WARNING', 'ERROR', 'SUCCESS')]
[string]$Type = 'INFO'
)
$timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss"
$color = switch ($Type) {
"ERROR" { "Red" }
"WARNING" { "Yellow" }
"SUCCESS" { "Green" }
default { "White" }
}
Write-Host "[$timestamp] $Type : $Message" -ForegroundColor $color
}
function Reset-MicroWinUpdate {
Write-LogMessage "Starting MicroWin-specific update repair..." -Type INFO
# Only essential services for MicroWin
$services = @(
'wuauserv', # Windows Update
'bits', # Background Intelligence Transfer
'cryptsvc' # Cryptographic Services
)
try {
# 1. Stop essential services
foreach ($service in $services) {
Stop-Service -Name $service -Force -ErrorAction SilentlyContinue
}
# 2. Clear update cache with proper permissions
$paths = @(
"$env:SystemRoot\SoftwareDistribution\Download",
"$env:SystemRoot\SoftwareDistribution\DataStore"
)
foreach ($path in $paths) {
if (Test-Path $path) {
takeown /f $path /r /d y | Out-Null
icacls $path /grant administrators:F /t | Out-Null
Remove-Item -Path $path -Recurse -Force -ErrorAction SilentlyContinue
}
}
# 3. Reset Windows Update database
if (Test-Path "$env:SystemRoot\System32\catroot2") {
Rename-Item "$env:SystemRoot\System32\catroot2" "$env:SystemRoot\System32\catroot2.old" -Force -ErrorAction SilentlyContinue
}
# 4. Clear Windows Update registry keys
$regPaths = @(
"HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate",
"HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate"
)
foreach ($regPath in $regPaths) {
if (Test-Path $regPath) {
Remove-ItemProperty -Path $regPath -Name "AccountDomainSid" -ErrorAction SilentlyContinue
Remove-ItemProperty -Path $regPath -Name "PingID" -ErrorAction SilentlyContinue
Remove-ItemProperty -Path $regPath -Name "SusClientId" -ErrorAction SilentlyContinue
}
}
# 5. Reset Windows Update components
$commands = @(
"sc.exe sdset bits D:(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRC;;;AU)(A;;CCLCSWRPWPDTLOCRRC;;;PU)",
"sc.exe sdset wuauserv D:(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRC;;;AU)(A;;CCLCSWRPWPDTLOCRRC;;;PU)"
)
foreach ($cmd in $commands) {
Start-Process "cmd.exe" -ArgumentList "/c $cmd" -Wait -WindowStyle Hidden
}
# 6. Start services
foreach ($service in $services) {
Set-Service -Name $service -StartupType Automatic -ErrorAction SilentlyContinue
Start-Service -Name $service -ErrorAction SilentlyContinue
}
# 7. Force update detection
Write-LogMessage "Forcing Windows Update detection..." -Type INFO
Start-Process "wuauclt.exe" -ArgumentList "/resetauthorization /detectnow" -Wait -WindowStyle Hidden
Write-LogMessage "MicroWin update repair completed" -Type SUCCESS
# Check build number
$build = (Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion").CurrentBuild
if ($build -eq "26100") {
Write-LogMessage "Note: KB5051987 might not be needed as you're already on build 26100" -Type WARNING
}
}
catch {
Write-LogMessage "Error during repair: $($_.Exception.Message)" -Type ERROR
return $false
}
return $true
}
# Main execution
if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
Write-LogMessage "Please run as Administrator" -Type ERROR
exit 1
}
Reset-MicroWinUpdate
$restart = Read-Host "A restart is recommended. Would you like to restart now? (y/n)"
if ($restart -eq 'y') {
Restart-Computer -Force
} How to Use
Important Notes
Additional TroubleshootingIf the issue persists after running the script, you can verify if the update is actually needed: Get-WmiObject -Class Win32_QuickFixEngineering | Where-Object { $_.HotFixID -eq "KB5051987" } You can also check the Windows Update logs: Get-WindowsUpdateLog Manual Installation AlternativeIf the script doesn't resolve the issue:
DISM /Online /Add-Package /PackagePath:path_to_update.msu Please let me know if you need any clarification or if the issue persists after trying these solutions. |
I don't know how to reopen this ticket?
#2118
Windows Update is failing for me. Just ran an install of MicroWin and can't update now.
The text was updated successfully, but these errors were encountered: