Is there a way to find out what the current video resolution is in Windows? I'm running a script that needs to know that the current resolution is. In the workstation, I found a regkey that changes values when the resolution changes, but this is missing on another machine. So, it seems that the value is machine specific and quite possibly installation specific.
So, how do we do it?
Page 1 of 1
How To *get* The Current Video Resolution
#2
Posted 01 March 2005 - 07:22 AM
#3
Posted 01 March 2005 - 08:58 AM
This is a simple vbs script which echoes the height and width
On Error Resume Next
Const wbemFlagReturnImmediately = &h10
Const wbemFlagForwardOnly = &h20
strComputer = "localhost"
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_DesktopMonitor", "WQL", _
wbemFlagReturnImmediately + wbemFlagForwardOnly)
For Each objItem In colItems
WScript.Echo "ScreenHeight: " & objItem.ScreenHeight
WScript.Echo "ScreenWidth: " & objItem.ScreenWidth
Next
#4
Posted 01 March 2005 - 01:19 PM
sixpack, on Mar 1 2005, 05:22 AM, said:
That was one of the first sites I found when searching. The script doesn't work on XP even though there are 3 different versions of it.
Thanks for responding though.
#5
Posted 01 March 2005 - 03:35 PM
PeonPower, on Mar 1 2005, 06:58 AM, said:
This is a simple vbs script which echoes the height and width
That was exactly what I was looking for.
Domo Arigato Gozaimasu
#6
Posted 02 March 2005 - 01:09 AM
Thank Scriptomatic 2.0 =]
Very useful program, select the class you need and it'll show a script that echoes all of the information of that class. Easy =]
Very useful program, select the class you need and it'll show a script that echoes all of the information of that class. Easy =]
#7
Posted 02 March 2005 - 01:18 AM
Yep, I like whole "matic" family... Adsimatic, scriptomatic and tweakomatic...
I think U could use wmic also, like wmic desktop get screenwidth, screenheight
I think U could use wmic also, like wmic desktop get screenwidth, screenheight
- ← Runonceex Background Image
- Unattended Windows 2000/XP/2003
- How To Add User On Unattended Installation? →
Share this topic:
Page 1 of 1



Help

Back to top








