Set
colItems equal to what comes back from issuing the WQL statement
"Select * from Win32_DisplayConfiguration" as you use the
ExecQuery method. Your code will look like the following:
Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_DisplayConfiguration")
Use a
For Each...Next loop to iterate through
colItems as you look for the following properties of the
Win32_DisplayConfiguration object: BitsPerPel, Caption, Description, DeviceName, DisplayFlags, DisplayFrequency, DriverVersion, LogPixels, PelsHeight, PelsWidth, SettingID, and SpecificationVersion. Use the variable
objItem to assist you in iterating through the collection. Make sure you close out the
For Each...Next loop with the
Next command. Your code will look like the following:
For Each objItem in colItems
WScript.Echo "BitsPerPel: " & objItem.BitsPerPel
WScript.Echo "Caption: " & objItem.Caption
WScript.Echo "Description: " & objItem.Description
WScript.Echo "DeviceName: " & objItem.DeviceName
WScript.Echo "DisplayFlags: " & objItem.DisplayFlags
WScript.Echo "DisplayFrequency: " & objItem.DisplayFrequency
WScript.Echo "DriverVersion: " & objItem.DriverVersion
WScript.Echo "LogPixels: " & objItem.LogPixels
WScript.Echo "PelsHeight: " & objItem.PelsHeight
WScript.Echo "PelsWidth: " & objItem.PelsWidth
WScript.Echo "SettingID: " & objItem.SettingID
WScript.Echo "SpecificationVersion: " & objItem.SpecificationVersion
Next