Get display resolution in VBScript

  • Thread starter Thread starter Rob Collins
  • Start date Start date
R

Rob Collins

Hello. I need to get the display resolution (e.g. 800 x
600) in a VBScript. I need the script to work on NT4
clients. I found a solution in the Microsoft Script Center
but this does not appear to work on NT4 clients without
WMI installed. Please help! I may have to teach myself
JavaScript if I can't find a solution!
 
Rob said:
Hello. I need to get the display resolution (e.g. 800 x
600) in a VBScript. I need the script to work on NT4
clients. I found a solution in the Microsoft Script Center
but this does not appear to work on NT4 clients without
WMI installed. Please help! I may have to teach myself
JavaScript if I can't find a solution!

Hi

Try this one:

With CreateObject("HtmlFile").ParentWindow
sScreenSize = .Screen.Width & "x" & .Screen.Height
End With

WScript.Echo sScreenSize


Tip: this type of question is better asked in the Windows Script Host group
microsoft.public.scripting.wsh, URL to the Web interface for this group:

http://msdn.microsoft.com/newsgroup...d=us&newsgroup=microsoft.public.scripting.wsh
 
That works excellently! Thanks very much! I spent 3
fruitless hours searching the web, which is really
frustrating because I knew it'd be a simple solution.

Thanks! I'm one step away from walking around town with a
sandwhich board proclaiming, "I love Microsoft" :-)

Rob
 
Back
Top