Windows update stuck at 0% download status
Often is we find an environment missing software updates it’s easy for someone without hands on experience to say, ‘just patch’. Outside of change requests, outside of authorisation, maintenance windows, roll back plans, communications etc. there is also the fact that ‘just patching’ isn’t that simple. Even for fairly standard patching tasks using Windows Updates you sometimes hit a snag. Today I’m looking at exactly that issue on a server, so I thought I’d post the steps to resolve an issue but also, I think this is a nice way to highlight the realities of patching.
We show a GUI and command line (PowerShell) method to achieve this result (the PowerShell isn’t fancy but I figured you could go away and upgrade that if you fancied some fun). Windows update sometimes has issues (does not all software!) and it is sometimes that we need to help it along the way, so let’s get too it!
Routine
Stop the windows update service
Run services.msc
Stop the windows update service
In this example I had to disable the service then reboot the server rather than just stop it (it was hanging on stopping)
Next navigate to C:\Windows\SoftwareDistribution
Now remove all the files.
Once that is complete re-enable/start the windows update service:
We can now see it running:
The SoftwareDistribution folder will have some files and folders re-created. Now re-check for updates:
Or use the gui command:
wuauclt.exe /updatenow |
Now we can see the windows updatesd are no longer paused at 0%.
We can obviosuly write a quick powershell script for this, this one isn’t fancy but has the core components in it.
$Service = Get-Service -Name wuauserv
if($service.Status -eq “Running”){ $Service.Stop() del C:\Windows\SoftwareDistribution -Recurse -Confirm } elseif($service.Status -eq “Stopped”){ del C:\Windows\SoftwareDistribution -Recurse -Confirm } else { #catch all } $Service.Start() wuauclt.exe /updatenow |
Patching Realities
Before you just tell everyone to ‘just patch’ remember it is not that simple. It requires, time effort, planning and almost certainly is supported by automation but snags occur along the way!