标题: 可以用CreateObject创建的WMI对象
作者: Demon
链接: https://demon.tw/programming/createobject-wmi-object.html
版权: 本博客的所有文章,都遵守“署名-非商业性使用-相同方式共享 2.5 中国大陆”协议条款。
WMI对象有很多,但并不是所有的WMI对象都可以用CreateObject函数来创建,只有少部分可以。
'By Demon 'https://demon.tw 'create an object for WMI in VBScript by calling CreateObject Set objSWbemDateTime = CreateObject("WbemScripting.SWbemDateTime") Set objSWbemLocator = CreateObject("WbemScripting.SWbemLocator") Set objSWbemObjectPath = CreateObject("WbemScripting.SWbemObjectPath") Set objSWbemNamedValueSet = CreateObject("WbemScripting.SWbemNamedValueSet") Set objSWbemRefresher = CreateObject("WbemScripting.SWbemRefresher") Set objSWbemSink = CreateObject("WbemScripting.SWbemSink") Set objSWbemLastError = CreateObject("WbemScripting.SWbemLastError") 'If error information is not available, an attempt to create an error object will fail.
参考链接:http://msdn.microsoft.com/zh-cn/library/windows/desktop/aa389744%28v=vs.85%29.aspx
赞赏微信赞赏支付宝赞赏
随机文章: