(view source code of checkres.vbs as plain text)
Option ExplicitDim intBpp, intHor, intRC, intVertDim colItems, objItem, objWMIServiceDim strQueryintRC = 0
intBpp = 0
intHor = 0
intVert = 0
With WScript.Arguments.Unnamed
If .Count = 2 Or .Count = 3 Then
If IsNumeric( .Item(0) ) Then
intHor = CInt( .Item(0) )
ElseSyntax
End If
If IsNumeric( .Item(1) ) Then
intVert = CInt( .Item(1) )
ElseSyntax
End If
If .Count = 3 Then
If IsNumeric( .Item(2) ) Then
intBpp = CInt( .Item(2) )
ElseSyntax
End If
End If
ElseSyntax
End If
End With
strQuery = "SELECT * FROM Win32_DisplayConfiguration"
Set objWMIService = GetObject( "winmgmts://./root/CIMV2" )
Set colItems = objWMIService.ExecQuery( strQuery, "WQL", 48 )
For Each objItem In colItems
If objItem.PelsWidth < intHor Then intRC = 1
If objItem.PelsHeight < intVert Then intRC = 1
If objItem.BitsPerPel < intBpp Then intRC = 1
NextSet colItems = Nothing
Set objWMIService = Nothing
WScript.Quit intRC
Sub Syntax With WScript.Echo "CheckRes.vbs, Version 1.01" _
& vbCrLf _& "Check if the screen resolution meets your minimum requirements" _
& vbCrLf & vbCrLf _
& "Usage: CSCRIPT //NoLogo CHECKRES.VBS min_hor min_vert [ min_bpp ]" _
& vbCrLf & vbCrLf _
& "Where: ""min_hor"" is the minimum required horizontal resolution in pixels" _
& vbCrLf _& " ""min_vert"" is the minimum required vertical resolution in pixels" _
& vbCrLf _& " ""min_bpp"" is the minimum required number of bits per pixel" _
& vbCrLf & vbCrLf _
& "Written by Rob van der Woude" _
& vbCrLf _& "http://www.robvanderwoude.com"
.Quit 2
End With
End Sub
page last modified: 2025-10-11; loaded in 0.0071 seconds