WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Samples from Users

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Enabling Automatic Updates


Enabling Automatic Updates
SCHEDULED_INSTALLATION = 4
objAutoUpdate = CreateObject("Microsoft.Update.AutoUpdate")
objSettings = objAutoUpdate.Settings
objSettings.NotificationLevel = SCHEDULED_INSTALLATION
objSettings.Save()


Determining the Automatic Updates Schedule

objAutoUpdate = CreateObject("Microsoft.Update.AutoUpdate")
objSettings = objAutoUpdate.Settings
day = objSettings.ScheduledInstallationDay
Switch day
    Case 0
        line1 = "Scheduled installation day: Every day"
		  break
    Case 1
        line1 = "Scheduled installation day: Sunday"
		  break
    Case 2
        line1 = "Scheduled installation day: Monday"
		  break
    Case 3
        line1 = "Scheduled installation day: Tuesday"
		  break
    Case 4
        line1 = "Scheduled installation day: Wednesday"
		  break
    Case 5
        line1 = "Scheduled installation day: Thursday"
		  break
    Case 6
        line1 = "Scheduled installation day: Friday"
		  break
    Case 7
        line1 = "Scheduled installation day: Saturday"
		  break
    Case day
       line1 = "The scheduled installation day is could not be determined."
EndSwitch

If objSettings.ScheduledInstallationTime = 0 
    line2 =  "Scheduled installation time: 12:00 AM"
ElseIf objSettings.ScheduledInstallationTime = 12 Then
    line2 =  "Scheduled installation time: 12:00 PM"
Else
    If objSettings.ScheduledInstallationTime > 12 Then
        intScheduledTime = objSettings.ScheduledInstallationTime - 12
        line2 = intScheduledTime : ":00 PM"
    Else
        line2 = objSettings.ScheduledInstallationTime : ":00 AM"
    End If
End If

Message("", line1 : @lf : line2)


Modifying the Automatic Updates Schedule

EVERY_THURSDAY = 5
FOUR_AM = 4
objAutoUpdate = CreateObject("Microsoft.Update.AutoUpdate")
objSettings = objAutoUpdate.Settings
objSettings.ScheduledInstallationDay = EVERY_THURSDAY
objSettings.ScheduledInstallationTime = FOUR_AM
objSettings.Save()



Article ID:   W17457
File Created: 2008:04:10:15:10:48
Last Updated: 2008:04:10:15:10:48