清风的blog 优然探索

vbs 检测更新补丁

strComputer = "."
Set objWMIService = GetObject ("winmgmts:{impersonationLevel = impersonate}!\\" & strComputer & "\root\cimv2")
Set colQuickFixes = objWMIService.ExecQuery(" Select * from Win32_QuickFixEngineering")
Set objFS = CreateObject ("Scripting.FileSystemObject")
Set objNF = objFS.CreateTextFile("InstallHotfixes.htm")
objNF.Writeline "<html>"
objNF.writeline "<head>"
objNF.writeline "<title>InstallHotfixes</title>"
objNF.writeline "</head>"
objNF.writeline "<body>"
objNF.writeline "<h3>Hotfix report -- Date:"&Now()&" </h3>" & vbcrlf
objNF.writeline "<table border = 1 style = font-size:9pt>"
objNF.writeline "<tr>"
objNF.writeline "<td>Computer:</td>"
objNF.writeline "<td>Description:</td>"
objNF.writeline "<td>HotFixID:</td>"
objNF.writeline "<td>Installation Date:</td>"
objNF.writeline "<td>Installed By:</td>"
objNF.writeline "</tr>"
for each objQuickFix in colQuickFixes
objNF.writeline "<tr>"
objNF.writeline "<td> "& objQuickFix.CSName & "</td> "
objNF.writeline "<td> "& objQuickFix.Description &" </td> "
objNF.writeline "<td> "& objQuickFix.HotFixID &" </td>"
objNF.writeline "<td> "& objQuickFix.InstallDate &" </td>"
objNF.writeline "<td> "& objQuickFix.InstalledBy &" </td>"
objNF.writeline "</tr>"
next
objNF.writeline "</table>"
objNF.writeline "</body>"
objNF.writeline "</html>"
objNF.close
set objshell = wscript.createobject("wscript.shell")
objshell.run "InstallHotfixes.htm"
 

2008年10月25日 | 发布:admin | 分类:学习收藏 | 评论:0

发表留言: