Screen Resolution revisited
- From: Gerry Hickman <gerry666uk@xxxxxxxxxxx>
- Date: Tue, 05 Jul 2005 20:59:41 +0100
Hi,
I tried Torgeir's scripts today (see below) on a range of video hardware (Intel and ATI) and found the correct information was returned. Very useful!
The only slight oddity, was that the very new Intel chipsets are producing more than one 'item' in the collection and the second item takes about four seconds to retrieve, and then returns 'null' for both horizontal and vertical with both scripts.
I'm guessing this is related to some kind of dual monitor support? It would be good if there was something a bit like wot u get with network adapters where you can set a condition 'Primary=true' to only get the primary display...
'--------------------8<---------------------- strComputer = "." ' use "." for local computer Set objWmi = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" _ & strComputer & "\root\cimv2")
Set colItems = objWmi.ExecQuery _
("Select * from Win32_VideoController")For Each objItem in colItems WScript.Echo objItem.CurrentHorizontalResolution WScript.Echo objItem.CurrentVerticalResolution Next '--------------------8<----------------------
'--------------------8<---------------------- strComputer = "." ' use "." for local computer Set objWmi = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" _ & strComputer & "\root\cimv2")
Set colItems = objWmi.ExecQuery _
("Select * from Win32_DesktopMonitor")For Each objItem in colItems WScript.Echo objItem.ScreenWidth WScript.Echo objItem.ScreenHeight Next '--------------------8<----------------------
-- Gerry Hickman (London UK) .
- Prev by Date: Delete Script Maps item
- Next by Date: Re: Use WMI to change printer settings like duplex, resolution etc??
- Previous by thread: Delete Script Maps item
- Next by thread: Error backing up wmi repository
- Index(es):
Relevant Pages
|