from _winreg import *
"""print r"*** Reading from SOFTWAREMicrosoftWindowsCurrentVersionRun ***" """
aReg = ConnectRegistry(None,HKEY_LOCAL_MACHINE)
aKey = OpenKey(aReg, r"SOFTWAREMicrosoftWindowsCurrentVersionUninstall")
for i in range(1024):
try:
asubkey=EnumKey(aKey,i)
val=QueryValueEx(asubkey, "DisplayName")
print val
except EnvironmentError:
break
Could anyone please correct the error...i just want to display the "DisplayName" within the subkeys of the key the HKLMSOFTWAREMicrosoftWindowsCurrentVersionUninstall
This is the error i get..
Traceback (most recent call last):
File "C:/Python25/ReadRegistry", line 10, in <module>
val=QueryValueEx(asubkey, "DisplayName")
TypeError: The object is not a PyHKEY object
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…