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



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

Answer / 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

More VB Script Interview Questions

In the Web page we have a table link, if we click on that link all the contents under that link will be sorted (asscending/Descending). Now i want to check in which order the list is ? for that i need to get the data in to some var How can i get that cells data?

0 Answers   Nous,


I wrote the vbscript code on notepad i was geeting run time error "object required line 1" my code is set usernameobj=Descriptive.Create() usernameobj( "name").value="Username" set passwordobj=Descriptive.Create() passwordobj("name").value="password" set signinobj=Descriptive.Create() signin("name").value="sigin" browser("gmail").page("gmail").WebEdit("usernameobj").set ("enter username") Browser("gmail").Page("gmail").WebEdit("passwordobj").Setsec ure.Crypt.Encrypt("entr password") browser("gmail").page("gmail").WebButton("siginobj").click pls tell me whats wrong

1 Answers  


Why to use option explicit in vb script?

0 Answers  


Write a VB Script to count blank Lines in a notepad

2 Answers   IBM,


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

0 Answers  


how to write basic programs in VB Script like addition, multiplication?

14 Answers  


Diff between web table ,datatable and data base (QTP)

2 Answers   TCS,


What is the use of option explicit statement?

0 Answers  


What is the main difference between function and sub-procedure?

0 Answers  


How can you create an object in vbscript?

0 Answers  


Hi, Anybody could tell me What is the script for Reverse of Given number. Ex:236--632. Thanks in Advance..

10 Answers   Amazon, CSC,


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

0 Answers  


Categories