separator = "*" * 80
keyPath = r"Software\Microsoft\Windows\CurrentVersion\Uninstall"
for subkey in names:
try:
path = keyPath + "\\" + subkey
key = OpenKey(HKEY_LOCAL_MACHINE, path, 0, KEY_ALL_ACCESS)
try:
temp = QueryValueEx(key, 'DisplayName')
temp1 = QueryValueEx(key, 'DisplayVersion')
temp2 = QueryValueEx(key, 'Publisher')
display = str(temp[0])
display_ver=str(temp1[0])
display_p=str(temp2[0])
print ('Display Name: ' + display + '\nDisplay
version: ' + display_ver + '\nVendor/Publisher: ' + display_p
+'\nRegkey: ' + subkey + '\n')
except:
print ('Regkey: ' + subkey + '\n')
except:
fp = StringIO.StringIO()
traceback.print_exc(file=fp)
errorMessage = fp.getvalue()
#error = 'Error for ' + key + '. Message follows:\n' +
errorMessage
#HelperFuncs.LogError(error)
There shouldn't be any difference. What error do you get, exactly?
Also, let me point out that you can access the registry in a couple of
ways, without invoking the overhead of WMI. I grant you that they are a
bit wordier, but it might get you around this issue.
--
Tim Roberts, ti...@probo.com
Providenza & Boekelheide, Inc.
You don't say what the error is (and your snippet doesn't run without
some alterations) so would you mind showing just enough code for
the error to occur plus a cut-and-paste of the traceback?
> Am not able to get hold of a wmi module for python on 64 bit machines.
> Is there one at all?
The wmi module is pure Python, relying only on Python & the pywin32
extensions. If you have both of those installed as 64-bit you can
just drop the wmi.py module into the right place and go from there.
TJG