<UVKCommandsScript>
<AutoItScript>
#RequireAdmin
$updateSession = ObjCreate("Microsoft.Update.Session")
$updateSession.ClientApplicationID = "UVK Script example"
$updateSearcher = $updateSession.CreateUpdateSearcher()
ProgressOn("Windows updater", "Searching for updates...")
$searchResult = $updateSearcher.Search("IsInstalled=0 and Type='Software' and IsHidden=0")
$updateCount = $searchResult.Updates.Count
If $updateCount = 0 Then
ProgressOff()
MsgBox(0,"Windows updater", "There are no applicable updates.")
Exit 1
EndIf
ProgressSet(0, "Creating list of available updates...")
$output_text = 'List of missing updates:' & @CRLF & @CRLF
For $i = 0 To $updateCount-1
$update = $searchResult.Updates.Item($i)
$output_text &= $i & ': ' & $update.Title & @CRLF
Next
ProgressOff()
$hfile = FileOpen(@DesktopDir & '\MissingUpdates.txt', 34)
FileWrite($hfile, $output_text)
FileClose($hfile)
MsgBox(0, 'Missing Updates', $output_text)