Automatic Updates can sometimes be an issue

So, all day long I kept noticing the Automatic Updates shield down in my systray on my work laptop. I knew eventually I was going to have to take care of it, but I figured I was going to wait until later this evening. When work was over, I shut down my laptop. Frak, I already had the updates downloaded and ready to install. So I let the machine start updating as I get ready to go.

svchost.exe — application error the instruction at “0x########” reference memory at “0×00000000″. the memory could not be ‘read’

Frak again. Immediately I knew nothing good was going to come of this, so I closed the lid and took it home. I figured the following were going to be in my list of problems:

  1. My computer was, for all intents, dead. It had locked up during an installation of an update while Windows XP was shutting down. Reinstall is my only way out.
  2. Some portion of Windows XP was now corrupt, and I was going to waste some time figuring out what by going through Safe Mode and fixing it before I could get into Windows.
  3. Windows was going to be fine, except for one thing, and I would at least be able to get into Windows normally.

Fortunately, my fears were unfounded, as my computer did start up with no problems. Well, it did seem to take a bit longer to load the user profile, but then again, that could have been normal and I just didn’t notice. When I got into Windows, I was given an error message about a generic service being shut down. A quick Google of “svchost dies during windows update” led me to a list of feeds about windows updates, from which then led me to an article called “Windows Update Broke My Machine” which lists what they did to solve the problem, which worked for me as well, as the files that were already downloaded to my machine didn’t appear to want to install.

  1. Boot the PC, right click “My Computer” and hit properties.
  2. Click the Automatic Updates tab.
  3. Turn off Automatic Updates.
  4. Reboot the computer.
  5. When the machine is booted, manually go to Windows Updates.
  6. Do a complete Windows Update.
  7. Reboot if the Updates don’t already insist that you do.

Fortunately, that worked. After all, I don’t work tomorrow, so I didn’t want to spend my day off trying to get my laptop working so I could use it over the weekend.

Comments (1)

VB6 code for setting Automatic Updates in Windows XP with Service Pack 2

Now, I know the currently this post will not interest my two known visitors, but this was part of a program to configure student’s computer that I made for work. In the next week or so I will be adding code samples for setting other network configuration items. Maybe one day I will add an exe or something.


Private Sub SetAutoUpdate()
    On Error Resume Next
    Dim strAUOptions As String
    Set WshShell = CreateObject("WScript.Shell")
    strAUOptions = WshShell.RegRead("HKLM\Software\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\AUOptions")

    If strAUOptions <> "4" Then
        MsgBox "Automatic Updates has been detected as not being set to Automatic (the recommended setting)." & vbCrLf & "It will be set to download updates everyday at 6:00 AM."

        ' Create the keys that need to be written and then
        ' write the values into the keys

        ' Set download/install type to 4, which is automatically
        WshShell.RegWrite "HKLM\Software\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\", "AUOptions"
        WshShell.RegWrite "HKLM\Software\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\AUOptions", "00000004", "REG_DWORD"

        'WshShell.RegWrite "HKLM\Software\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\", "NoAutoUpdate"
        'WshShell.RegWrite "HKLM\Software\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\NoAutoUpdate", "00000000", "REG_DWORD"

        ' Set day to download/install to 'Everyday'
        WshShell.RegWrite "HKLM\Software\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\", "ScheduledInstallDay"
        WshShell.RegWrite "HKLM\Software\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\ScheduledInstallDay", "00000000", "REG_DWORD"

        ' Set time to download/install to 5:00 AM
        WshShell.RegWrite "HKLM\Software\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\", "ScheduledInstallTime"
        WshShell.RegWrite "HKLM\Software\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\ScheduledInstallTime", "00000006", "REG_DWORD"

        ' Reboot after installing if someone is logged in
        WshShell.RegWrite "HKLM\Software\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\", "NoAutoRebootWithLoggedOnUsers"
        WshShell.RegWrite "HKLM\Software\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\NoAutoRebootWithLoggedOnUsers", "00000001", "REG_DWORD"

        ' Set number of hours to check for updates if no connection to 14 hours
        WshShell.RegWrite "HKLM\Software\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\", "RescheduleWaitTime"
        WshShell.RegWrite "HKLM\Software\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\RescheduleWaitTime", "00000014", "REG_DWORD"
    End If
End Sub

3/12/07 Update: I recently tried this code on a installation of Windows Vista, and everything appeared to work.

Comments