我是脚本和编程的新手。
在以下和类似的脚本中,我注意到存在一个在“For Each”循环中引用的“objOperatingSystem”。我知道“colSettings”是一个包含 WMI 集合的变量,但“objOperatingSystem”从何而来?
请帮忙。谢谢!!!
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" _
& strComputer & "\root\cimv2")
Set colSettings = objWMIService.ExecQuery _
("Select * from Win32_OperatingSystem")
For Each objOperatingSystem in colSettings
Wscript.Echo "Available Physical Memory: " & _
objOperatingSystem.FreePhysicalMemory
Next