Object Required

Batch, ASP, JScript, Kixtart, etc.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 13 years and 8 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
kylerlawrence
Posts: 1
Last visit: Sun Jul 04, 2010 10:37 pm

Object Required

Post by kylerlawrence »

Hi guys, hoping someone can help me out.
I am trying to write an application that will be able to display set computer information in a span however i keep getting the error message Object required.

Code: Select all

Sub GetGeneral
        strComputer = "."
        Set objWMIService = GetObject("winmgmts:" & strComputer & "rootcimv2")
	
        Set colOperatingSystems = objWMIService.ExecQuery _
            ("Select * from Win32_OperatingSystem")
strHtml = strHtml & " Operating System: " & objOperatingSystem.Caption & ""
strHtml = strHtml & " Service Pack: " & objOperatingSystem.ServicePackMajorVersion & ""
	
DataArea1.InnerHtml = strHtml
End Sub

I think the rest of the code is okay apart from the above.
Any suggestion what is wrong here? as im fairly new to this i can't figure it out.

Cheers.
This topic is 13 years and 8 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked