Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Script Not Displaying Results

Status
Not open for further replies.

JEngles

MIS
May 21, 2003
93
AU
Can some please tell me why this simple script isn't diplaying any results. I have tried running it through cscript and wscript. I don't seem to have any problems running any others. Thanks.

'On Error Resume Next
Dim strComputer
Dim objWMIService
Dim propValue
Dim objItem
Dim SWBemlocator
Dim UserName
Dim Password
Dim colItems

strComputer = "."
UserName = ""
Password = ""
Set SWBemlocator = CreateObject("WbemScripting.SWbemLocator")
Set objWMIService = SWBemlocator.ConnectServer(strComputer,"root\CIMV2",UserName,Password)
Set colItems = objWMIService.ExecQuery("Select * from Win32_VideoConfiguration",,48)
For Each objItem in colItems
WScript.Echo "AdapterDescription: " & objItem.AdapterDescription
WScript.Echo "Description: " & objItem.Description
WScript.Echo "DeviceSpecificPens: " & objItem.DeviceSpecificPens
WScript.Echo "MonitorManufacturer: " & objItem.MonitorManufacturer
WScript.Echo "MonitorType: " & objItem.MonitorType
WScript.Echo "Name: " & objItem.Name
WScript.Echo "ScreenHeight: " & objItem.ScreenHeight
WScript.Echo "ScreenWidth: " & objItem.ScreenWidth
Next
 
What OS are you running the script on?

I just checked my Vista x64 system and the Win32_VideoConfiguration class does not exist there. Took a look on my wife's XP system and she does have that class.

Are you executing this on Vista?

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
Work SMARTER not HARDER. The Spider's Parlor's Admin Script Pack is a collection of Administrative scripts designed to make IT Administration easier! Save time, get more work done, get the Admin Script Pack.
 
Thanks guys, that did the trick. It never occured to me that they removed that class.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top