How would I loop through all the values of a Windows Registry Key using the Python module _winreg. I have code that will do what I want, but it is
For iterating through keys and values of registry, you would need EnumKey()
and EnumValue()
method from _winreg
module. Note that these two methods, take index as an argument, and will provide you the key (or value) only for the given index. Therefore, in order to get all the keys (or values) you need to increment the index by one and continue until WindowsError
has not encountered.
This post might help you for a detailed understanding on the same. The Github link for the code can be found in the post.