-
February 22nd, 2011, 10:10 PM
#1
Help I'm a Newb with an idea....
Hi everyone, I fairly new to vbs and I'm trying to get an idea I have to work by piecing together scripts and hoping for the best . I don't know to much about writing the script but I understand the basic principles of programing and the general flow of how a script should work.
So here it goes I'm looking to make a script that will query the display properties and set the resolution to variables. It will then use those stored variables in a web link and open the link. So basically a computer has its resolution 1280 x 1024 the script will read that and then open a web link in the following format:
http://obtraceweb/connect.htm?fs=1&w...0&height=1024&
I need the width and the height to be populated by the variables it reads off the pc.
So far I have found some code that will read the resolution and display the info in gui boxes:
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery _
("Select * From Win32_DisplayConfiguration")
For Each objItem in colItems
Wscript.Echo "Name: " & objItem.DeviceName
Wscript.Echo "Color depth: " & objItem.BitsPerPel
Wscript.Echo "Horizontal resolution: " & objItem.PelsWidth
Wscript.Echo "Vertical resolution: " & objItem.PelsHeight
Next
Set colItems = objWMIService.ExecQuery _
("Select * From Win32_DisplayConfiguration")
And I also found some code to open a web link:
strURL = ""
Set objShell = CreateObject("Wscript.Shell")
objShell.Run(strURL)
So I'm a newb like I said and I need a solution. I'm missing what I need as far as populating variables. Do I need an Array to store what the code gets from that file? I'm very lost any help is much appreciated.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|