无忧启动论坛

标题: 哪种情况才使用SWbemServices.Get [打印本页]

作者: yjqd    时间: 2021-1-27 13:45
标题: 哪种情况才使用SWbemServices.Get


下面两个脚本结果一样
哪种情况才使用SWbemServices.Get呢

-------------------------------------------------------------------------------------------


Set objWMIService = GetObject("winmgmts:")
Set clsobjProcess = objWMIService.Get("Win32_LogicalDisk")

Set colProcesses = clsobjProcess.Instances_()
    WScript.Echo colProcesses.count

For Each Process in colProcesses
    WScript.Echo Process.Name
Next

-------------------------------------------------------------------------------------------
Set objWMIService = GetObject("winmgmts:")
Set clsobjProcess = objWMIService.InstancesOf("Win32_LogicalDisk")
    WScript.Echo clsobjProcess.count

For Each Process in clsobjProcess
    WScript.Echo Process.Name
Next






欢迎光临 无忧启动论坛 (http://bbs.c3.wuyou.net/) Powered by Discuz! X3.3