|
下面两个脚本结果一样
哪种情况才使用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
|
|