原帖由 vipxin1987 于 2009-2-26 16:08 发表 
5 楼 可以给各思路好吗? 别水贴阿 说点有用的好么?
好...
我不水吧...
首先...取得一份最新补丁列表... 这个貌似有点废话 不过还是要说...
然后 利用WMI 来获取软件安装列表 推荐用Win32_ProductSoftwareFeatures.... 获取的结果 正则匹配下就ok...
我这里Win32_Product试下来貌似有点小问题...代码么 用scriptomatic.exe生成吧...
WMI具体我也不是很熟悉...
剩下的...就不用说了...
; 生成于 AutoIt Scriptomatic
$wbemFlagReturnImmediately = 0x10
$wbemFlagForwardOnly = 0x20
$colItems = ""
$strComputer = "localhost"
$Output=""
$Output = $Output & "Computer: " & $strComputer & @CRLF
$Output = $Output & "==========================================" & @CRLF
$objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\CIMV2")
$colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_ProductSoftwareFeatures", "WQL", _
$wbemFlagReturnImmediately + $wbemFlagForwardOnly)
If IsObj($colItems) then
For $objItem In $colItems
$Output = $Output & "Component: " & $objItem.Component & @CRLF
$Output = $Output & "Product: " & $objItem.Product & @CRLF
if Msgbox(1,"WMI Output",$Output) = 2 then ExitLoop
$Output=""
Next
Else
Msgbox(0,"WMI 输出","No WMI Objects Found for class: " & "Win32_ProductSoftwareFeatures" )
Endif
|