I have an IronPython script that looks for current running processes using WMI. The code looks like this:
import clr
clr.AddReference('System.Management')
from System.Management import ManagementClass
from System import Array
mc = ManagementClass('Win32_Processes')
procs = mc.GetInstances()
That last line where I call the GetInstances()
method raises the following error:
Traceback (most recent call first):
File "<stdin>", line 1, in <module>
SystemError: Not Found
I am not understanding what's not being found?!? I believe that I may need to pass an instance of ManagementOperationObserver
and of EnumerationOptions
to GetInstance()
however, I don't understand why that is, since the method with the signature Getinstance()
is available in ManagementClass
.