遍历注册表 Python [英] Loop through Registry Python

查看:90
本文介绍了遍历注册表 Python的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试编写一个小应用程序,如果它是一个 REG_SZ,它会检查 Windows 注册表中的每个值的有效文件路径.我需要能够循环遍历读取每个值的所有键和子键.我查看了 _winreg,但找不到此任务的任何明确示例.任何帮助都会很棒!

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!

推荐答案

_winreg.OpenKey 打开给定的注册表项._winreg.EnumKey 枚举给定注册表项的子项.

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

你有 _winreg.HKEY_CLASSES_ROOT 和朋友键常量.

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

您还需要什么?

这篇关于遍历注册表 Python的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆