[python-win32] Python WMI SCript to get installed software

Tim Golden mail at timgolden.me.uk
Wed Jul 25 21:14:03 CEST 2012


On 25/07/2012 18:23, Carlos Hotmail wrote:
> Hi all on the list.
>
> The following question is regarding an error that raises when i try to execute this script:
> import _winreg
> import wmi
>
> r = wmi.Registry ()
> result, names = r.EnumKey (
>    hDefKey=_winreg.HKEY_LOCAL_MACHINE,
>    sSubKeyName="Software"
> )
> for key in names:
>    print key and this is the error message it give me:
>
> Traceback (most recent call last):
>    File "C:\Python27\wmitest8.py", line 7, in <module>
>      sSubKeyName="Software"
>    File "C:\Python27\lib\site-packages\wmi.py", line 431, in __call__
>      handle_com_error ()
>    File "C:\Python27\lib\site-packages\wmi.py", line 241, in handle_com_error
>      raise klass (com_error=err)
> x_wmi: <x_wmi: Unexpected COM Error (-2147352567, 'Ocurri\xf3 una excepci\xf3n.', (0, u'SWbemProperty', u'Los tipos no coinciden ', None, 0, -2147217403), None)>

I can't see any issue on Win7 Python 2.7

If you still can't get it to work, could you produce a dump of the 
interpreter session in case something's getting lost in translation?

TJG


More information about the python-win32 mailing list