write a program to display the system specifications of
client system with the help of vb script.

Answer Posted / vasanth

Sub Screen_Resolution
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer
& "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * From
Win32_DisplayConfiguration")
For Each objItem in colItems
'msgbox "Name: " & objItem.DeviceName
'msgbox "Color depth: " & objItem.BitsPerPel
'msgbox "Horizontal resolution: " & objItem.PelsWidth
'msgbox "Vertical resolution: " & objItem.PelsHeight
If objItem.PelsWidth <> 1024 Or objItem.PelsHeight <> 768
Then
MsgBox "Current screen resolution is "
&objItem.PelsWidth& " by " &objItem.PelsHeight
MsgBox "Scripts cannnot be executed, We only support 1024
by 768 "
ExitAction()
End if
Next
End Sub

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Hi, Can anyone please send me vb script examples to practice vb and also material to learn vb scripting in QTP? my email id : hareen_11@yahoo.com

1826


Can u describe what kind of testing are for OTC derivates by banks.

1670


What are the properties of regexp object?

581


If a calulator having 3 buttons (of any number)in 3 of them one is not working properly due to which answer is wrong always. write a script to find out which button is not working properly ?

1564


Explain few date functions in vbscript?

616






How will you convert a string to lower case string using vbscript?

561


What is difference between vbscript and vba?

612


Out of the different type of operators, which are evaluated first and last in the vbscript language?

567


what is diff between static and dynaic arrys?

1590


How to Import data from a file (file is on the desktop) to the data table

1562


Can we create Crystal Report object in QTP?If yes then what it is and what are its various properties?

3038


Which operator can be used to do an xor operation in vbscript?

684


Mention when to use function procedures and what are its characteristics?

629


What if you do not specify anything when you call a procedure?

540


Which event is triggered when mouse focus comes out of an element in the vbscript language?

515