Скрипт, который из Microsoft Update получает список доступных обнавлений.
Работает медленно, но может пригодится...
Описание на MSDN. [more=Скрипт vbs]
Dim Act : Set Act = CreateObject("Wscript.Shell")
Dim Fso : Set Fso = CreateObject("Scripting.FileSystemObject")
Dim KbRpt : KbRpt = Act.ExpandEnvironmentStrings("%UserProfile%\Desktop\UpdateReport.txt")
'/->
Dim UpDateSearcher,UpDateSession,SearchResult
Set UpDateSession = CreateObject("Microsoft.Update.Session")
Set UpDateSearcher = UpDateSession.CreateUpDateSearcher()
Set SearchResult = UpDateSearcher.Search("IsInstalled=0 and Type='Software'")
'/->
Dim Line1, TS
Line1 = Space(3) & chr(171) & " ----------------------------------- " & Chr(187)
Set TS = Fso.CreateTextFile(KbRpt)
TS.WriteLine Space(3) & "List Of Updates For This Machine" & vbCrLf & Line1 & vbCrLf
'/->
Dim Cnt, I,Update, Rpt
'/->
For I = 0 To SearchResult.Updates.Count-1
Set Update = SearchResult.Updates.Item(I)
Cnt = Cnt + 1
If Cnt > 9 Then
Cnt = Cnt
ElseIf Cnt = 9 Then
Cnt = "0" & Cnt
ElseIf Cnt < 9 Then
Cnt = "0" & Cnt
End If
'/->
Rpt = Rpt & Space(2) & " > Update number : " & Cnt & vbCrLf
Rpt = Rpt & Space(2) & " > Title : " & Update.Title & vbCrLf
Rpt = Rpt & Space(2) & " > Published : " & Update.LastDeploymentChangeTime & vbCrLf
Rpt = Rpt & Space(2) & " > Max Download size: " & Update.MaxDownloadSize & vbCrLf
Rpt = Rpt & Space(2) & " > Description : " & Update.Description & vbCrLf
For Each strArticle in Update.KBArticleIDs
Rpt = Rpt & Space(2) & " > KB article :
http://support.microsoft.com/kb/" & strArticle & "/en-us" & vbCrLf
Next
For Each strInfo in Update.MoreInfoUrls
Rpt = Rpt & Space(2) & " > More Info : " & strInfo & vbCrLf
Next
Rpt = Rpt & vbCrLf
'/->
Next
'/-> If No Updates Are Found
If SearchResult.Updates.Count = 0 Then
Act.Popup "There Are No Applicable Updates Found.",0,"No Updates",4128
WScript.Quit
End If
'/->
TS.WriteLine Rpt
TS.Close()
'/->
Set I = Fso.GetFile(KbRpt)
Act.Run("Notepad.exe " & I.Path),1,True
Dim ZZ1 : ZZ1 = Act.Popup("Did You Want To Keep The Update Report",0,"Keep Or Delete",4132)
If ZZ1 = 7 Then I.Delete() End If
[/more]