Random Project

Windows Update disabled error

Great script.

I got an error due to win update being disabled. I’ve modified the script for this scenario. Put this in the top of “main”:

”””””””””””
‘ Main
”””””””””””
Set objAutoUpdate = CreateObject(“Microsoft.Update.AutoUpdate”)

If objAutoUpdate.ServiceEnabled “True” Then
Wscript.Echo “Windows Update service disabled on client. Please enable.”
Wscript.Quit(intCritical)
End If

Set objSettings = objAutoUpdate.Settings

If objSettings.NotificationLevel = 1 Then
Wscript.Echo “Windows Update notification level is set to ‘Never check for updated (not recommended)’ – please change to ‘Check for updates but let me choose wether to download and install them’ or higher.”
Wscript.Quit(intCritical)
End If

intResultDetect = objAutoUpdate.DetectNow