Page 1 of 2 12>
Topic Options
#18512 - 2002-03-12 04:54 PM Generic Screen Resolution
Austin Offline
Seasoned Scripter

Registered: 2002-01-24
Posts: 439
Is there a way to determine screen resolution for all OS remotely? I have found many posts on this topic and it seems there are many ways to do it but some work for some os and then others work for others... is anyone aware of a way to read screen res remotely?

Thanks for the help
_________________________
Austin Henderson

Top
#18513 - 2002-03-12 05:39 PM Re: Generic Screen Resolution
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
the screen res is located here:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\SERVICES\ATIRAGE3\DEVICE0

Note that ATIRAGE3 is the video card installed, you woyld have to ENUMKEY if you wanted to script it.

I'm not certain if wintendo keeps their stuff here...
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#18514 - 2002-03-12 07:43 PM Re: Generic Screen Resolution
Austin Offline
Seasoned Scripter

Registered: 2002-01-24
Posts: 439
Hmm there must be a better way to detect the current resolution... EnumKey would require me to know every device in my network and make a decision based upon what I can enum from it... icky.

Hmm...

I have this now.. but it seems to be working sometimes and not others...

code:
 "Discovering remote resloution:        "

$videokey="\\$MACHINE\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Services\"
$VidCard= enumkey("$videokey",$index)
if @error=0
$video=$videokey+$VidCard+"\Device0"
$xres=readvalue("$video","DefaultSettings.XResolution")
else
$xres=640
endif

The problem is on 2K pro machines.. they all have docks... the current res on the one I am testing on is 1024x768 but following the above I get 640x480.. there are several other HWProfiles listed there but current seems to me that it should be CURRENT...

I am confused.... why would this be? The results not why am I confused?
[Smile]
_________________________
Austin Henderson

Top
#18515 - 2002-03-12 07:45 PM Re: Generic Screen Resolution
Austin Offline
Seasoned Scripter

Registered: 2002-01-24
Posts: 439
Listed profiles are
0000
0001
0002
CURRENT

So why would current not give me CURRENT reading?
_________________________
Austin Henderson

Top
#18516 - 2002-03-12 08:38 PM Re: Generic Screen Resolution
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
see if there are additional devices.

increment $index and loop it
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#18517 - 2002-03-14 12:05 AM Re: Generic Screen Resolution
MCA Offline
KiX Supporter
*****

Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
Dear,

It would be nice we can use one generic piece of code to retrieve
f.e. settings of your monitor.
Only the problem is Microsoft has changed the registry structure many time.
The differences are exist during windows 95/NT period.

Our script monitor.kix which you can find on our site returns
resolution for different windows versions.
greetings.
_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

Top
#18518 - 2002-07-22 10:19 AM Re: Generic Screen Resolution
ash wilson (kyosei) Offline
Getting the hang of it

Registered: 2002-04-22
Posts: 58
Loc: auckland new zealand
MCA,

I have downloaded and run your monitor.kix but it shows 3 cards all with the same resolution.

C:\downloads\kix\wanadoo>kix32 monitor

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Services\ati2mpab
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Services\ATIRAGE3
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Services\MNMDD

display resolution=[ati2mpab=(X='1024',Y='768')],[ATIRAGE3=(X='1024',Y='768')],[MNMDD=(X='1024',Y='768')]

The actual adapater being used is the second one but how do I determine this?

What registry location has an entry for the actual adapter in use.

My pc is a Compaq Armada 1750 laptop running Win2k but I also want to use your script on win95/98 desktops and laptop to document all our current pcs adapters.

Appreciate any further help you can give.

kyosei (for the common good)
_________________________
KYOSEI. There are only three groups of people that can count. Those that can, and those that can't.

Top
#18519 - 2002-07-22 02:36 PM Re: Generic Screen Resolution
MCA Offline
KiX Supporter
*****

Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
Dear,

We will take a look at it.
Question: which kixtart version running?
greetings.
_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

Top
#18520 - 2002-07-22 02:58 PM Re: Generic Screen Resolution
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
WMI is your friend!

Win32_VideoConfiguration has the properties ActualColorResolution, HorizontalResolution, RefreshRate, and VerticalResolution which should give you what you're looking for.
_________________________
There are two types of vessels, submarines and targets.

Top
#18521 - 2002-07-24 11:21 AM Re: Generic Screen Resolution
ash wilson (kyosei) Offline
Getting the hang of it

Registered: 2002-04-22
Posts: 58
Loc: auckland new zealand
MCA
Thanks for your interest.
Am using ver 4.10 RC2 on all workstations.

Jens
Do not know how to use WMI.
An help appreciated.

rgds ash
_________________________
KYOSEI. There are only three groups of people that can count. Those that can, and those that can't.

Top
#18522 - 2002-07-24 04:00 PM Re: Generic Screen Resolution
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
Heres a sampling of the info you can get from the WIN32_VideoController class. I switched you from Jens suggestion (VideoConfiguration) to VideoController as the former is no longer supported in WinXP and will result in an error. There are 59 properties available to read from, here are a few...

code:
$strComputer = "."
$objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\"+$strComputer+"\root\cimv2")

$objVideo = $objWMIService.ExecQuery("select * from Win32_VideoController")

For each $Video in $objVideo
? " Name: " $Video.Name
? " Resolution: " $Video.CurrentHorizontalResolution " x " $Video.CurrentVerticalResolution
? " Current Colors: " $Video.CurrentNumberOfColors
? "Current Refresh: " $Video.CurrentRefreshRate
Next



[ 24 July 2002, 16:01: Message edited by: Chris S. ]

Top
#18523 - 2002-07-24 06:02 PM Re: Generic Screen Resolution
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Damn Microsoft, why do they have to change everything when they release a new operating system? Chris, do you have a list of classes that are no longer supported by Windows XP?
_________________________
There are two types of vessels, submarines and targets.

Top
#18524 - 2002-09-13 01:39 AM Re: Generic Screen Resolution
ash wilson (kyosei) Offline
Getting the hang of it

Registered: 2002-04-22
Posts: 58
Loc: auckland new zealand
MCA,
Just wondering if you have discovered any more info on this topic.
rgds ash
_________________________
KYOSEI. There are only three groups of people that can count. Those that can, and those that can't.

Top
#18525 - 2002-09-13 01:44 AM Re: Generic Screen Resolution
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
ash...

mca is currently on vacation... almost two months now. but if you keep checking on the topic you will find a answer.
other way to catch him/them is to email...

what comes to your name, it's nice you have this () thing in there. this way I remembered you...

anyway,
cheers!
 
_________________________
!

download KiXnet

Top
#18526 - 2002-11-02 07:38 AM Re: Generic Screen Resolution
ash wilson (kyosei) Offline
Getting the hang of it

Registered: 2002-04-22
Posts: 58
Loc: auckland new zealand
Bump!

MCA, any progress on my querie?

Chris S., is that Kix code you posted?

rgds ash
_________________________
KYOSEI. There are only three groups of people that can count. Those that can, and those that can't.

Top
#18527 - 2002-11-02 08:01 AM Re: Generic Screen Resolution
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
ash,

Have you had a look at the UDF library and specifically, WMIQuery() - Used to execute a query against WMI?

If you look at the line:
quote:

$SystemSet = GetObject("winmgmts:{impersonationLevel=impersonate}!//$computer")

You should be able to change $computer that to be any computer you have on the domain.

HTH,

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#18528 - 2002-11-02 08:29 AM Re: Generic Screen Resolution
ash wilson (kyosei) Offline
Getting the hang of it

Registered: 2002-04-22
Posts: 58
Loc: auckland new zealand
Kent,
Thanks! I will check it out.
ash
_________________________
KYOSEI. There are only three groups of people that can count. Those that can, and those that can't.

Top
#18529 - 2002-11-02 09:36 AM Re: Generic Screen Resolution
ash wilson (kyosei) Offline
Getting the hang of it

Registered: 2002-04-22
Posts: 58
Loc: auckland new zealand
Kent,
Thanks, I tested it on 2k and works fine, probably won't work on Wintendo tho.

Chris,
Thanks too, tested yours and works fine also on 2k, Wintendo probably not a goer too.

rgds ash
_________________________
KYOSEI. There are only three groups of people that can count. Those that can, and those that can't.

Top
#18530 - 2002-11-02 05:07 PM Re: Generic Screen Resolution
kholm Offline
Korg Regular
*****

Registered: 2000-06-19
Posts: 714
Loc: Randers, Denmark
ash,

If you want to enable remote detection of (current) screenresolution on Win9x, you have to install either remote registry support or WMI (or both) on your Win9x ws'es.
On NT you might want to install WMI

Have you tried GetScreenRes()

You can use this to log the settings at logon time if you make it part of your logon (inventory) and let the info be written to a file on a common share.

-Erik

Top
#18531 - 2002-11-04 09:10 AM Re: Generic Screen Resolution
ash wilson (kyosei) Offline
Getting the hang of it

Registered: 2002-04-22
Posts: 58
Loc: auckland new zealand
Erik,
Thanks for the info & comments.

We only have 2 groups of workstations, 95/98 and 2K/XP. Worked ok on my 2k wksta but have not yet tried other 2k wkstas or XP wkstas. Do they both have WMI installed by default?

ALL 9x have remote registry installed and we use it regularly. How does this help to get the screen res? Don't really want to install WMI on all of them but will do so if it's easier than another way, or gives better control.

Appreciate your experience.
ash
_________________________
KYOSEI. There are only three groups of people that can count. Those that can, and those that can't.

Top
Page 1 of 2 12>


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
1 registered (StuTheCoder) and 798 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.069 seconds in which 0.022 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org