Showing posts with label automatic updates. Show all posts
Showing posts with label automatic updates. Show all posts

Thursday, August 14, 2008

Problems with windows updates? System takes forever to shut down?

Most problems with windows updates can be fixed by one of the two following methods :



If none of your updates are installing (they all say installation failed), it's possible the windows update files have become corrupted.
Stop the windows update service - right click "my computer", click "manage" then navigate to : services and applications > services

find the automatic updates service and stop it (right click > stop)

then delete the folder c:\windows\softwaredistribution (or replace c:\windows with wherever your windows installation is), this contains all the windows update files. don't worry, the folder will be automatically recreated when windows update is next run.

start the automatic updates service again and run windows update once more. updates should be re-downloaded and should install fine.




If windows update itself fails with an error code, there are a number of causes for this. In fact at one point, installing SP3 caused this very problem!

Here's the fix.
at the run prompt, type exactly as written :
notepad c:\fix_wu.cmd

notepad will open and prompt you to create a new file, choose YES.
Note : we have to open notepad this way because we need a file with .cmd extension, any other method will always add the .txt extension.

then, inside notepad, paste the following code :

net stop wuauserv
regsvr32 /s wuapi.dll
regsvr32 /s wups.dll
regsvr32 /s wups2.dll
regsvr32 /s wuaueng.dll
regsvr32 /s wuaueng1.dll
regsvr32 /s wucltui.dll
regsvr32 /s wuweb.dll
regsvr32 /s jscript.dll
regsvr32 /s atl.dll
regsvr32 /s softpub.dll
regsvr32 /s msxml3.dll
net start wuauserv

save (NOT save as !) the file

then go to run and type "c:\fix_wu.cmd", windows will run the script and window updates should be fixed - revisit the windows update site to confirm.

Another symptom caused by this is difficulty with shutting down a system, where it would take a very long time to shut down, even on a relatively clean machine. Even manually closing processes in the task manager doesn't seem to hurry up the process, which could take well over 5 minutes. And if you don't ever visit the windows update site, you may be completely unaware of a problem with windows updates, or you may be aware of the problem but not realize that it has any connection with the slow shutdowns whatsoever.

The only information that can be found is in error message in the event viewer : "The server {9B1F122C-2982-4E91-AA8B-E071D54F2A4D} did not register with DCOM within the required timeout.", which annoyingly, doesn't really tell us anything.

However, all of these things are related, and the above (second) fix for windows updates does in fact solve the problem.

Disabling reboot after automatic updates

Personally i hate it when windows forces the issue that a reboot is required after an update has been installed. Sure, if a reboot is needed I'm happy to oblige, but in my own time. If I'm busy working on a system, or it's downloading a large file for me, I don't want windows popping up a dialog box every 10 minutes reminding me to restart, or worse, deciding to restart for me if I've left the computer downloading stuff.

Thankfully, there is a way to fix this. After searching online, I found several solutions, however they all seem to apply only to XP Professional. Here's two methods that work for XP Pro :

One option is by making changes to group policy. At the run prompt type gpedit.msc and then navigate to : local computer policy > computer configuration > administrative templates > windows components > windows update. There's two settings you can change here - either enable "no auto-restart for scheduled automatic updates installations" or adjust the setting for "Re-prompt for restart with scheduled installations" and make the delay much much longer (the default is every 10 minutes - I've set mine to once a day).
(thanks to http://www.codinghorror.com for this tip)

The other choice is a registry edit. open regedit and navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU
Then add a DWORD value "NoAutoRebootWithLoggedOnUsers" and set the value to 1 to enable it.
(from http://support.microsoft.com/kb/328010)

But if you're on XP home (as my laptop is) then neither of these choices work. Thankfully, there's a registry hack similar to the one from the microsoft KB article which works just fine :

Open regedit and navigate to HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\

Then add a DWORD value "NoAutoRebootWithLoggedOnUsers" and set the value to 1 to enable it.

As usual, any registry editing is done at your own risk, and if you trash your OS it's your own fault. If you're not sure, don't do it.