我不熟悉腳本和編程。瞭解For Each Loop
在以下和類似的腳本中,我注意到存在'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
這是什麼編程語言? – Maz
@Maz'vbscript'或'vba'。 – brettdj