0

On Windows XP, in my vbscript, I am using

GetObject("winmgmts:\.\root\cimv2")

to get WMI service object, but always get error: (null): Invalid syntax. I checked the syntax, it should be ok. I even tried to rebuild the Repo as suggested here , but still got the same error. I guess it might be permission/security policy issue. Any suggestions?

RRUZ
  • 134,889
  • 20
  • 356
  • 483
ericyoung
  • 621
  • 2
  • 15
  • 21

1 Answers1

2

Your syntax is wrong you are missing a \

instead use

GetObject("winmgmts:\\.\root\cimv2");

or even better you can get the instance of the WMI class directly including the WMI path

GetObject("winmgmts:\\.\root\cimv2:Win32_LogicalDisk='C:'")
RRUZ
  • 134,889
  • 20
  • 356
  • 483