python script to find Installed programs in Uninstall folder in registry
I am working on creating a python script to find Installed programs in
Uninstall folder in registry, the script works perfectly fine on 32
bit machines but errors out with a wmi error on 64 bit machines. Am
not able to get hold of a wmi module for python on 64 bit machines.Is
there one at all? Please ignore indentation errors. I found this
script in some forum, apologies for not giving due credit to the
r = wmi.Registry()
result, names = r.EnumKey (hDefKey=HKEY_LOCAL_MACHINE,
separator = "*" * 80
keyPath = r"Software\Microsoft\Windows\CurrentVersion\Uninst all"
for subkey in names:
path = keyPath + "\\" + subkey
key = OpenKey(HKEY_LOCAL_MACHINE, path, 0, KEY_ALL_ACCESS)
temp = QueryValueEx(key, 'DisplayName')
temp1 = QueryValueEx(key, 'DisplayVersion')
temp2 = QueryValueEx(key, 'Publisher')
display = str(temp)
print ('Display Name: ' + display + '\nDisplay
version: ' + display_ver + '\nVendor/Publisher: ' + display_p
+'\nRegkey: ' + subkey + '\n')
print ('Regkey: ' + subkey + '\n')
fp = StringIO.StringIO()
errorMessage = fp.getvalue()
#error = 'Error for ' + key + '. Message follows:\n' +
Re: python script to find Installed programs in Uninstall folderin registry
On 15/03/2011 03:42, KishoreRP wrote:
> I am working on creating a python script to find Installed programs in
> Uninstall folder in registry, the script works perfectly fine on 32
> bit machines but errors out with a wmi error on 64 bit machines.
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.
|All times are GMT. The time now is 03:57 PM.|
Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.