Python WinReg Path Wildcard -


i trying values out of registry. problem is, 1 of subkeys "unknown". example, key networked drive of "z".
"hkey_current_user/network/z"

here current basic code looks specifically.

try:     t = openkey(hkey_current_user, r"network\\z", 0, key_all_access)        = 0     while true:         subkey = enumvalue(t, i)         # print subkey[0], "  ", subkey[1]         += 1 except windowserror:     # windowserror: [errno 259] no more data available     pass 

how can add "wildcard" "network\z" part in case more 1 network path other z?

untested:

key = openkey(hkey_current_user, 'network', 0, key_all_access) # open root network key. ndrives = queryinfokey(key)[0] # number of subkeys inside. in range(ndrives): # each subkey index...     drive = enumkey(key, i) # subkey name.     t = openkey(hkey_currenr_user, 'network\\' + drive, 0, key_all_access) # open drive key.     # stuff t.