error

J

Jimmy

hi,

now i tried to use wmi, i wrote the following codes

strComputer = "abc-01"

Set wbemServices = GetObject("winmgmts:\\" & strComputer)
Set wbemObjectSet =
wbemServices.InstancesOf("Win32_LogicalMemoryConfiguration")

For Each wbemObject In wbemObjectSet
WScript.Echo "Total Physical Memory (kb): " &
wbemObject.TotalPhysicalMemory
Next
error message is the remote server machine does not exist or is unavailable:
'GetObject'code: 800A01CEsource: Microsoft VBScript runtime errorI run the
vbs file in my computer (xpp sp2) is fine but when i tried to get another
computer's information, the above error was shown.please help.thanksjimmy
 
G

Guest

your code like should be like this

Set wbemServices = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")


you simply forgot ("\root\cimv2"). That's all. Try that and see how it works.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top