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
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
Can u describe what kind of testing are for OTC derivates by banks.
What are the properties of regexp object?
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 ?
Explain few date functions in vbscript?
How will you convert a string to lower case string using vbscript?
What is difference between vbscript and vba?
Out of the different type of operators, which are evaluated first and last in the vbscript language?
what is diff between static and dynaic arrys?
How to Import data from a file (file is on the desktop) to the data table
Can we create Crystal Report object in QTP?If yes then what it is and what are its various properties?
Which operator can be used to do an xor operation in vbscript?
Mention when to use function procedures and what are its characteristics?
What if you do not specify anything when you call a procedure?
Which event is triggered when mouse focus comes out of an element in the vbscript language?