WMI Help

3c273 nospam at nospam.com
Thu Jul 13 11:55:36 EDT 2006


Hello,
When I run the following at an interactive interpreter on Windows XP, I get
the expected results. But if I save it to a file and run it, it generates
the following error. (And it generates the same error either way on Windows
2000)

import wmi
c=wmi.WMI()
for item in c.win32_PhysicalMedia():
    print item


Traceback (most recent call last):
  File "<pyshell#32>", line 1, in ?
    for item in c.win32_PhysicalMedia():
  File "wmi.py", line 850, in __getattr__
    return getattr (self._namespace, attribute)
  File "C:\Python24\lib\site-packages\win32com\client\dynamic.py", line 489,
in __getattr__
    raise AttributeError, "%s.%s" % (self._username_, attr)
AttributeError:
winmgmts:{impersonationLevel=impersonate,authenticationLevel=default}//./roo
t/cimv2.win32_PhysicalMedia

Any help is appreciated.
Louis





More information about the Python-list mailing list