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

Carlos Hotmail cjfd48 at hotmail.com
Wed Jul 25 19:23:36 CEST 2012


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’m on a win7 machine, python 2.7 installed, and win32 library installed.

what i’m trying to do is to get the installed software on the machine, but not with the Win32_Product, because the list it posts seems incomplete, not all the installed software is on that list.

Thanks in advance for the help you can privide me.

Carlos Fuentes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-win32/attachments/20120725/7fa72e8f/attachment.html>


More information about the python-win32 mailing list