我是新手,对脚本和编程不太熟悉。
在以下及类似的脚本中,我注意到存在一个名为“objOperatingSystem”的变量,它在“For Each”循环中被引用。 我知道“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