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.

"system32" window opens on startup

simple one this. open msconfig, check the startup list, and remove any blank entries.

Restore damaged CD/DVD drives

A fairly common problem I've witnessed is that of CD and DVD drives "disappearing" from the system. Opening the device manager shows them to be present, but with the yellow exclamation symbol indicating a problem. Attempting to uninstall or reinstall the devices doesn't solve anything.

Here's the fix, it's a registry hack :

Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class
Find the key {4D36E965-E325-11CE-BFC1-08002BE10318}
then delete all VALUE data from UpperFilters and LowerFilters
Note DO NOT delete the key or the strings! only delete the VALUE data!
Exit and reboot. Problem solved.

Usual disclaimer : don't go poking around the registry if you don't know what you're doing. If you bork your system, it's your fault and nobody else.

disabling automatic restart on system failure from the registry

If for some reason you are completely unable to disable "automatic restart on system failure" on a system which will not boot, there is another way. It's possible to disable this from the registry, which can be edited offline with the appropriate tools, for example from a system recovery boot disc.

Open regedit and navigate to :

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Crashcontrol
(note this key, specifically "currentcontrolset" may not appear depending on circumstances)

and any/all of

HKEY_LOCAL_MACHINE\System\ControlSet001\Control\Crashcontrol
HKEY_LOCAL_MACHINE\System\ControlSet002\Control\Crashcontrol
HKEY_LOCAL_MACHINE\System\ControlSet003\Control\Crashcontrol
etc...

under each one, change the value for "autoreboot" to zero.

the usual registry disclaimer applies, if you mess around with stuff you don't understand you can and probably will trash your system...!

which services are hiding inside svchost.exe ?

if you're like me, you probably spend far too much time inside the task manager, trying to identify which applications are hogging too many resources, and what bottlenecks might be present in the system.

it's not too uncommon to see one of the many svchost.exe processes using lots of resources, but it's not easy to identify what's causing the problem here.

for those who don't know, svchost.exe is simply a process wrapper for windows services. each svchost.exe "contains" a bunch of windows services. so when one of these is maxing out the CPU or using far too much RAM, it can be useful to know which services are relevant - then you can begin stopping or restarting them to see which one is causing the problem.

there's two methods for identifying what services are hiding within each svchost.exe

the first one uses the "tasklist" command-line application.

note : tasklist is only included in XP professional, however it can easily be downloaded for use on XP home. there's many links to be found on google, here's one : http://www.computerhope.com/download/winxp/tasklist.exe

firstly however, we need to make sure we can see the process ID for each process in the task manager. in the task manager, go to the view menu and click "select columns". in the dialog that pops up, make sure "PID (process identifier)" is enabled, and click OK. then sort the process list alphabetically by clicking on the "image name" heading, this way all the svchost.exe processes are grouped together. check which one is causing the problem and make a note of it's PID.

at the command prompt, type exactly as written (including quotes) :

tasklist /svc /fi "imagename eq svchost.exe"

this will list all of the svchost processes with their relevant process ID and what services each one contains. find the one with the PID that matches the one you made a note of earlier - and check the services listed under that one.

the other (and possibly much simpler) solution is to use process explorer from system internals (recently acquired by microsoft), you can download this from http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx

it's an alternative to the task manager, and a big improvement too. it shows what services are active inside each svchost.exe, so while it won't list all the services contained within each one, you would expect the one causing a problem to be listed as it would be active.

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.

Tuesday, August 12, 2008

Missing desktop and screensaver tabs from display settings

after a virus attack, the display settings on this dell notebook were missing the desktop and screensaver tabs.

they can be restored with a small registry fix, thus :

open regedit and navigate to HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System

delete the following keys if they are present:
NoDispBackgroundPage
NoDispScrSavPage

the usual registry editing caveats apply, in other words, if you're not sure then don't do it