(view source code of getres.vbs as plain text)
On Error Resume Next
strMsg = vbCrLf
' Display help if any command line parameter is specified
If WScript.Arguments.Count Then
strMsg = strMsg _
& "GetRes.vbs, Version 1.00 for Windows 2000" & vbCrLf _
& "Display screen resolution and refresh rate" _
& vbCrLf & vbCrLf _
& "Usage: CSCRIPT GETRES.VBS" _
& vbCrLf & vbCrLf _
& "Written by Rob van der Woude" & vbCrLf _
& "http://www.robvanderwoude.com" _
& vbCrLf & vbCrLf _
& "Created with Microsoft's Scriptomatic tool" & vbCrLf _
& "http://www.microsoft.com/technet/treeview/default.asp" _
& "?url=/technet/scriptcenter/WMImatic.asp" _
& vbCrLf & vbCrLf & vbCrLf
End If
' Retrieve information
Set objWMIService = GetObject( "winmgmts://./root/cimv2" )
Set colItems = objWMIService.ExecQuery( "Select * from Win32_DisplayConfiguration", , 48 )
' Format output
For Each objItem in colItems
strMsg = strMsg _
& "VideoCard : " & objItem.DeviceName & vbCrLf _
& "XResolution : " & objItem.PelsWidth & vbCrLf _
& "YResolution : " & objItem.PelsHeight & vbCrLf _
& "BitsPerPel : " & objItem.BitsPerPel & vbCrLf _
& "VRefresh : " & objItem.DisplayFrequency & vbCrLf
Next
' Display the result
WScript.Echo strMsg
page last modified: 2024-04-16; loaded in 0.0178 seconds