Loop through Registry Python

大城市里の小女人 提交于 2020-01-06 12:55:04

问题


I am trying to write a small application that checks each value in the Windows Registry for valid file paths, provided it is a REG_SZ. I need to be able to loop through all of the keys and subkeys reading each value as I go. I looked in to _winreg, but couldn't find any clear examples for this task. Any help would be great!


回答1:


_winreg.OpenKey to open a given registry key. _winreg.EnumKey to enumerate the sub-keys of a given registry key.

And you have the _winreg.HKEY_CLASSES_ROOT and friends key constants.

What else do you need?



来源:https://stackoverflow.com/questions/6053867/loop-through-registry-python

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!