如何使用WMI枚举所有ActiveX元素?

是否可以使用WMI脚本枚举所有(或仅启用)ActiveX元素(* .dll,* .ocx)?

动机: ActiveXHelper

Solutions Collecting From Web of "如何使用WMI枚举所有ActiveX元素?"

Scritomatic V2工具有这样一些例子:

在错误恢复下一步 

const wbemFlagReturnImmediately =&h10
常量wbemFlagForwardOnly =&h20

arrComputers = Array(“*”)
对于每个strComputer在arrComputers
WScript.Echo
WScript.Echo“==========================================”
WScript.Echo“计算机:”&strComputer
WScript.Echo“==========================================”

设置objWMIService = GetObject(“winmgmts:\”&strComputer&“\ root \ CIMV2”)
设置colItems = objWMIService.ExecQuery(“SELECT * FROM Win32_ClassicCOMClass”,“WQL”,_
wbemFlagReturnImmediately + wbemFlagForwardOnly)

对于每个对象在colItems中
WScript.Echo“Caption:”&objItem.Caption
WScript.Echo“ComponentId:”&objItem.ComponentId
WScript.Echo“说明:”&objItem.Description
WScript.Echo“InstallDate:”&WMIDateStringToDate(objItem.InstallDate)
WScript.Echo“名称:”&objItem.Name
WScript.Echo“状态:”&objItem.Status
WScript.Echo
下一个
下一个

函数WMIDateStringToDate(dtmDate)
WScript.Echo dtm:
WMIDateStringToDate = CDate(Mid(dtmDate,5,2)&“/”&_
Mid(dtmDate,7,2)&“/”&Left(dtmDate,4)_
&“”&Mid(dtmDate,9,2)&“:”&Mid(dtmDate,11,2)&“:”&Mid(dtmDate,13,2))
结束功能