It Is a Modified Version of this Hey, Scripting Guy! script.
Save As A YOURNAME.vbs
Quote
Dim Description, Font1, GbB1, InTA, Table1, Table2, TD
Set objSession = CreateObject("Microsoft.Update.Session")
Set objSearcher = objSession.CreateUpdateSearcher
intHistoryCount = objSearcher.GetTotalHistoryCount
Table1 = "<Table Bgcolor=""#ededed"" width=""525"">"
Table2 = "<Table Bgcolor=""#dddddd"" width=""525"">"
TD = TD = "<TD STYLE=""font:8.75pt Palatino Linotype"" Width=""515"">"
Font1 = "<Font Style=""Arial"" font-weight""Bold-Italic"" "
Set GrB1 = WScript.CreateObject("InternetExplorer.Application")
GrB1.Navigate "Local:ListUpdates"
GrB1.ToolBar = 0
GrB1.StatusBar = 0
GrB1.Width=600
GrB1.Height = 405
GrB1.Left = 375
GrB1.Top = 125
GrB1.Visible = 1
Set Act = CreateObject("Wscript.Shell")
InTA = 1- 1
Set colHistory = objSearcher.QueryHistory(1, intHistoryCount)
For Each objEntry in colHistory
InTA = InTA + 1
GrB1.Document.Body.InnerHTML = "<center>" & Table2 & Font1 & "Color=""#c1c1c1""> Gsm List Updates " &_
"<center>" & Table2 & Font1 & "Color=""Green""><center>" &objEntry.Title & "</Table></TD>"&_
"<center>" & Table1 & "<TD STYLE=""font:9.75pt Palatino Linotype"" Width=""440"">" &_
"<TD STYLE=""font:9.75pt Palatino Linotype"" Width=""440"">" & Font1 & "Color=""#000ff""> This Was Installed On : " & objEntry.Date & "</Table></TD>" &_
"<center>" & Table2 & Font1 & "Color=""#0000f"">" & objEntry.Description & "</Table></TD>" &_
"<center>" & Table1 & Font1 & "Color=""Red"">How Many Updates Installed : " & Inta & "</Table></TD>"
WScript.Sleep 5500
Next
GrB1.Document.Body.InnerHTML ="<center>" & Table2 & Font1 & "Color=""#c1c1c1""> Completed The List Updates "
WScript.Sleep 5500
GrB1.quit
Blue Text Is The Array
Save As A YOURNAME.vbs
Quote
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Dim Act,Fso,INTA,SD,strComputer,strKB,TheFile,V,Report
Set Act = CreateObject("Wscript.shell")
Set Fso = CreateObject("Scripting.FileSystemObject")
''''''''''''''''''''''''''''''' Location For The Script ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
SD = Act.ExpandEnvironmentStrings("%SystemDrive%")
''''''''''''''''''''''''''''''' Misc Varibles For The Script '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Report = ("ListUpdate.Txt")
V = vbCrLf
strComputer = "."
''''''''''''''''''''''''''''''' Arrays For The Scrpt '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim KbL : KbL = Array (_
"KB835935", "KB887742", "KB885626", "KB873339", "KB885835", "KB834707",_
"KB885836", "KB886185", "KB890175", "KB873333", "KB888113", "KB891781",_
"KB888302", "KB883939", "KB890046", "KB893066", "KB896358", "KB896422",_
"KB896428", "KB890047", "KB890859", "KB890923")
INTA = 1-1
If Fso.FileExists(Report) Then Fso.DeleteFile(Report) End If
For Each StrKB In KbL
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colFiles = objWMIService.ExecQuery("Select * from CIM_DataFile Where FileName = '" & StrKB & "'")
INTA = INTA + 1
If colFiles.Count = 0 Then
Act.Popup "Missing", 3, "Missing", 0 + 32
end If
For Each objFile in colFiles
FName = Ucase(objFile.FileName)
Kbname = Ucase(objFile.FileName & "." & objFile.Extension)
KbPath = UCase(objFile.Drive & objFile.Path)
TheFile = KbPath & Kbname
Set WF = fso.OpenTextFile( Report, ForAppending, 2, true)
WF.WriteLine "'<-- The Start Time Of The Script " & Time & " -->How Many Times The Loop ran = " & Inta
WF.WriteLine "The Name of The Update : " & FName
WF.WriteLine "-----------------------------------------------------------"
Wf.WriteLine "The Download Location : " & V & TheFile
WF.WriteLine "'<-- The End Of The Search Time Of The Script " & Now & " -->" & V
Wf.Close
Next
Next
Act.Run(Report),1,True
Gsm = Act.Popup ("Did you want to keep the Report" &_
V & "Yes To Keep The Report" & V & "No To Keep The Report" &_
V & "There Is A 15 Second Time Out."& V & "Defualt Time Out Action Is" &_
V & "To delete The Reoprt", 15, "Keep Or Delete", 4 + 32)
If Gsm = 6 Then
Act.Popup "Keeping The Report End",3,"Keep The Report", 0 + 32
End If
If Gsm = 7 Then
Fso.DeleteFile(Report)
Act.Popup "Deleted The Report", 3, "Delete The Report", 0 + 32
End If
If Gsm = -1 Then
Fso.DeleteFile(Report)
Act.Popup "Deleted The Report", 3, "Delete The Report", 0 + 32
End If
I Fixed The Error Sorry It Was Just A Extra & In The Script
This post has been edited by gunsmokingman: 11 July 2005 - 05:44 AM



Help

Back to top










