swbemobjectex类的幽灵/隐藏方法(例如.Terminate)

6diegodiego9
Dim objList As WbemScripting.SWbemObjectSet
Set objList = GetObject("winmgmts:").ExecQuery("select * from win32_process where name='iexplore.exe'")

此代码返回与所有正在运行的进程“ iexplore.exe”有关SWbemObjectEx对象的集合
(如在任务管理器中所示)。

我在网上阅读了可以运行该方法的方法。终止这些对象可将其杀死。
但是,在中断模式下的“本地”窗口,“ SWbemObjectEx”类的对象浏览器以及https://docs.microsoft.com/it-ch/windows/win32/wmisdk/swbemobjectex上的官方文档都没有显示此方法终止

而且令我惊讶的是,尽管并非对所有对象都有效,但它仍然有效……

为什么呢?以及如何查看此类的所有这些hidden(?)方法?

计算机版本

.Terminate方法是的一部分Win32_Process类放置一个断点Call objProcess.Terminate并添加一个手表objProcess这将向您显示一个.Methods_集合,其中第二项是.Terminate

还要注意.Properties_集合以获取有关该进程的信息(例如,句柄)。

此子程序将集合打印到立即窗口,只需在循环中通过调用它objProcesses,例如

...
For Each objProcess In objProcesses
     PrintPropertiesAndMethods objProcess
...
Private Sub PrintPropertiesAndMethods(Process As WbemScripting.SWbemObjectEx)
    With Process
        Debug.Print vbCrLf & "Properties_ collection:"
        Dim Prop As WbemScripting.SWbemProperty
        For Each Prop In .Properties_
            With Prop
                Debug.Print .Name & " " & .Value
            End With
        Next
        Debug.Print vbCrLf & "Methods_ collection:"
        Dim Method As WbemScripting.SWbemMethod
        For Each Method In .Methods_
            With Prop
                Debug.Print Method.Name
            End With
        Next
    End With
End Sub

您必须小心终止,iexploror.exe因为它具有一个主进程(x64-C:\ Program Files \ Internet Explorer),该进程为每个选项卡创建一个子进程(x86-C:\ Program Files(x86)\ Internet Explorer)(签入任务管理器)。如果终止主进程,所有子进程也将终止。无法获得第二个主要测试流程,请使用Run as Admin

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

从防护类析构函数抛出异常会导致std :: terminate

来自分类Dev

how to terminate qthread in python

来自分类Dev

WbemObject.Terminate失败原因

来自分类Dev

objProcess.Terminate 未找到

来自分类Dev

JavaScript Web Worker-close()与Terminate()

来自分类Dev

Postgres pg_terminate_backend替代

来自分类Dev

特定命令上的Console.Terminate事件

来自分类Dev

特定命令上的Console.Terminate事件

来自分类Dev

boto3中的terminate_instances()和terminate()有什么区别?

来自分类Dev

QProcess :: kill()和QProcess :: terminate()有什么区别?

来自分类Dev

How to terminate loop gracefully when CTRL+C was pressed in python

来自分类Dev

未定义的符号SystemRuntimeMacOSX :: Initialize和SystemRuntimeMacOSX :: Terminate

来自分类Dev

zend Framework 2中的“ may_terminate”是什么?

来自分类Dev

Amazon RDS上pg_terminate_backend的权限

来自分类Dev

仅在kernel.terminate事件之后返回响应

来自分类Dev

使用Process.Terminate()时如何解决队列损坏

来自分类Dev

编写死亡测试以验证std :: set_terminate行为

来自分类Dev

python3 multiprocess.pool.terminate()不会杀死进程

来自分类Dev

zend Framework 2中的“ may_terminate”是什么?

来自分类Dev

处理Eclipse控制台上的Terminate按钮的单击?

来自分类Dev

Symfony2不触发kernel.terminate事件

来自分类Dev

进程的KILL,SUSPEND和TERMINATE有什么区别

来自分类Dev

Eclipse Terminate 上下文菜单条目变灰

来自分类Dev

如何隐藏超类的方法?

来自分类Dev

例如,类的Haskell方法不可见

来自分类Dev

boost python error message:terminate called after throwing an instance of 'boost::python::error_already_set'

来自分类Dev

VB6初始化事件,称为AFTER Terminate事件,用于用户控件

来自分类Dev

引发'boost :: python :: error_already_set'实例后调用boost python错误消息:terminate

来自分类Dev

Python子进程Popen.terminate()仍然停留在wait()上

Related 相关文章

  1. 1

    从防护类析构函数抛出异常会导致std :: terminate

  2. 2

    how to terminate qthread in python

  3. 3

    WbemObject.Terminate失败原因

  4. 4

    objProcess.Terminate 未找到

  5. 5

    JavaScript Web Worker-close()与Terminate()

  6. 6

    Postgres pg_terminate_backend替代

  7. 7

    特定命令上的Console.Terminate事件

  8. 8

    特定命令上的Console.Terminate事件

  9. 9

    boto3中的terminate_instances()和terminate()有什么区别?

  10. 10

    QProcess :: kill()和QProcess :: terminate()有什么区别?

  11. 11

    How to terminate loop gracefully when CTRL+C was pressed in python

  12. 12

    未定义的符号SystemRuntimeMacOSX :: Initialize和SystemRuntimeMacOSX :: Terminate

  13. 13

    zend Framework 2中的“ may_terminate”是什么?

  14. 14

    Amazon RDS上pg_terminate_backend的权限

  15. 15

    仅在kernel.terminate事件之后返回响应

  16. 16

    使用Process.Terminate()时如何解决队列损坏

  17. 17

    编写死亡测试以验证std :: set_terminate行为

  18. 18

    python3 multiprocess.pool.terminate()不会杀死进程

  19. 19

    zend Framework 2中的“ may_terminate”是什么?

  20. 20

    处理Eclipse控制台上的Terminate按钮的单击?

  21. 21

    Symfony2不触发kernel.terminate事件

  22. 22

    进程的KILL,SUSPEND和TERMINATE有什么区别

  23. 23

    Eclipse Terminate 上下文菜单条目变灰

  24. 24

    如何隐藏超类的方法?

  25. 25

    例如,类的Haskell方法不可见

  26. 26

    boost python error message:terminate called after throwing an instance of 'boost::python::error_already_set'

  27. 27

    VB6初始化事件,称为AFTER Terminate事件,用于用户控件

  28. 28

    引发'boost :: python :: error_already_set'实例后调用boost python错误消息:terminate

  29. 29

    Python子进程Popen.terminate()仍然停留在wait()上

热门标签

归档