from _winreg import *
areg=ConnectRegistry(None,HKEY_LOCAL_MACHINE)
akey=OpenKey(areg,"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall")
"""for i in range (259):"""
subkey=EnumKey(akey,0)
print subkey
demo=[]
demo=QueryValueEx(akey,"")
print demo
我试图获取子密钥中的值,这段代码有什么问题?
答案 0 :(得分:1)
尝试替换此行:
akey=OpenKey(areg,"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall")
与
akey=OpenKey(areg,r"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall")