win.EnumRegKey
Subkey = win.EnumRegKey (RootKey, Key, Index, [AccessMask])
Parameters:
RootKey: string (one of: "HKLM", "HKCC", "HKCR", "HKCU", "HKU")
Key: string (specify "" if RootKey itself is enumerated)
Index: integer (0-based)
AccessMask: flag ("KEY_WOW64_32KEY" or "KEY_WOW64_64KEY"; the default is 0)
Returns:
Subkey: string, or nil
Description:
This function enumerates subkeys of the given registry key.
Example of use:
-- Recursively delete registry keys
function win.DeleteRegKey_Recurse(RootKey, Key, AccessMask)
while true do
local subkey = win.EnumRegKey(RootKey, Key, 0, AccessMask)
if not (subkey and win.DeleteRegKey_Recurse(RootKey, Key.."\\"..subkey, AccessMask)) then
break
end
end
return win.DeleteRegKey(RootKey, Key, AccessMask)
end