当前位置:编程学习 > 网站相关 >>

列示出你安装了哪些补丁的脚本

作者:唐伯狼 来源:http://itbbs.pconline.com.cn/

心情不好的时候就四处翻资料看,偶尔发现了一个脚本,原本就是Winmag里的一个,只是搬到我这里时发现怎么也用不了,总是出错,于是手起刀落,改了改,OK了。

    其实是非常简单的列示已经安装了的补丁的脚本,执行后在脚本目录下生成一个*.htm文件,以表格的形式显示,很不错,呵呵,不想独享,拿过来给大家玩,希望各位会喜欢,呵呵。

*************  将本行以下部分复制到记事本中,保存为*.vbs文件后执行即可***************

 

使用脚本列示已经安装过的补丁
及其安装ID、描述、日期及实施者
strComputer = "."
Set objWMIService = GetObject ("winmgmts:{impersonationLevel = impersonate}!\" & strComputer & "ootcimv2")
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"


 

补充:综合编程 , 安全编程 ,
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,