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

发布于 2024-07-17 19:49:11 字数 164 浏览 3 评论 0原文

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

动机:ActiveXHelper

Is it possible to enumerate all (or just enabled) ActiveX elements (*.dll, *.ocx) with WMI script?

Motivation: ActiveXHelper

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

笑看君怀她人 2024-07-24 19:49:11

Scritomatic V2工具有一些这样的示例:
<代码>

On Error Resume Next

const wbemFlagReturnImmediately = &h10 const wbemFlagForwardOnly = &h20

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

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

对于 colItems 中的每个 objItem WScript.Echo“标题:”& objItem.Caption WScript.Echo "ComponentId:" & objItem.ComponentId WScript.Echo“描述:”& objItem.描述 WScript.Echo“安装日期:”& WMIDateStringToDate(objItem.InstallDate) WScript.Echo“名称:”& 对象项.名称 WScript.Echo“状态:”& objItem.Status WScript.Echo 下一个 下一个

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

Scritomatic V2 tool have some sample like that :

On Error Resume Next

Const wbemFlagReturnImmediately = &h10 Const wbemFlagForwardOnly = &h20

arrComputers = Array("*") For Each strComputer In arrComputers WScript.Echo WScript.Echo "==========================================" WScript.Echo "Computer: " & strComputer WScript.Echo "=========================================="

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

For Each objItem In colItems WScript.Echo "Caption: " & objItem.Caption WScript.Echo "ComponentId: " & objItem.ComponentId WScript.Echo "Description: " & objItem.Description WScript.Echo "InstallDate: " & WMIDateStringToDate(objItem.InstallDate) WScript.Echo "Name: " & objItem.Name WScript.Echo "Status: " & objItem.Status WScript.Echo Next Next

Function 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)) End Function

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文