On 24/10/2012 14:26, Kevin Holleran wrote: > On Wed, Oct 24, 2012 at 9:11 AM, Tim Golden <m...@timgolden.me.uk > Ok, try specifying the parameter names. (I remember someone having > problems before caused by mismatched param order): > > > > OK, tried that as well as specifying the parameters directly instead of > through variables, with the same result.... I even looked back through > my old scripts but I have not used the WMI module in this way... only to > do WMI queries...
Couple of things: Does the same thing happen if you run against your own machine? What's the result of the code below (which is basically "raw" WMI, without the wmi module): <code> import _winreg as winreg import win32com.client HKLM = winreg.HKEY_LOCAL_MACHINE NICs = "SYSTEM\\CurrentControlSet\\Control\\Class\\{4D36E972-E325-11CE-BFC1-08002bE10318}" registry = win32com.client.GetObject("winmgmts:/root/default:StdRegProv") EnumKey = registry.Methods_("EnumKey") params = EnumKey.InParameters.SpawnInstance_() params.Properties_.Item("hDefKey").Value = HKLM params.Properties_.Item("sSubKeyName").Value = NICs OutParameters = registry.ExecMethod_("EnumKey", params) print OutParameters.Properties_.Item("ReturnValue") print OutParameters.Properties_.Item("sNames") </code> TJG -- http://mail.python.org/mailman/listinfo/python-list