screen res in VBS

Ok, it’s got to be possible, how can I find the screen res in VBS, I’ve got an IE window I want to open in the centre for the screen, it’s got to be possible… somone must know how!

?

width in pixels = Screen.Width / Screen.TwipsPerPixelX
height in pixels = Screen.Height / Screen.TwipsPerPixelY

I was just comming back to say I’ve found a way

Dim gfx, colours, horiz, vert

strComputer = “.”

Set objWMIService = GetObject(“winmgmts:\” & strComputer & “\root\cimv2”)

Set colItems = objWMIService.ExecQuery _
(“Select * From Win32_DisplayConfiguration”)

For Each objItem in colItems
gfx = "Name: " & objItem.DeviceName
colours = "Color depth: " & objItem.BitsPerPel
horiz = "Horizontal resolution: " & objItem.PelsWidth
vert = "Vertical resolution: " & objItem.PelsHeight

Next

msgbox gfx & vbcrlf & colours & vbcrlf & horiz & vbcrlf & vert

I’ll try your way now too PMM