我怎样才能关闭注册表重定向Python的? [英] How can I turn off registry redirection on Python?

查看:280
本文介绍了我怎样才能关闭注册表重定向Python的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的程序试图创建的一个关键

My program is trying to create an key on the

HKLM\Software\Microsoft\Shared Tools\MSCONFIG\startupreg\test\

,而是钥匙上创建的

but instead the key is created on the

HKLM\Wow6432node\Software\Microsoft\Shared Tools\MSCONFIG\startupreg\test\

和不能正常工作,为什么?我该如何解决呢?

and don't work properly... Why? How can I solve it?

推荐答案

在反射主要功能的文档中WinReg项稀缺(和星星点点的缺失)。你真的需要这个补丁,但直到它的应用和新的微型版本的Python是用这些修复,至少你可以尝试 DisableReflectionKey 等途径,根据该补丁增加了文档(这里的RST对他们来说):

The docs on reflection-key features in winreg are scarce (and bits and pieces are missing). You really need this patch, but until it's applied and a new micro-release of Python is made with these fixes, at least you can try the DisableReflectionKey etc route according to the docs that patch adds (here's the RST for them):

+.. function:: DisableReflectionKey(key)
+   
+   Disables registry reflection for 32-bit processes running on a 64-bit
+   Operating System.
+   
+   *key* is an already open key, or one of the predefined :const:`HKEY_\*`
+   constants.
+   
+   Will generally raise :exc:`NotImplemented` if executed on a 32-bit
+   Operating System.

+   If the key is not on the reflection list, the function succeeds but has no
+   effect. Disabling reflection for a key does not affect reflection of any
+   subkeys.

+
+.. function:: EnableReflectionKey(key)
+
+   Restores registry reflection for the specified disabled key.
+   
+   *key* is an already open key, or one of the predefined :const:`HKEY_\*`
+   constants.
+
+   Will generally raise :exc:`NotImplemented` if executed on a 32-bit
+   Operating System.
+   
+   Restoring reflection for a key does not affect reflection of any subkeys.
+
+
+.. function:: QueryReflectionKey(key)
+
+   Determines the reflection state for the specified key.
+   
+   *key* is an already open key, or one of the predefined :const:`HKEY_\*`
+   constants.
+   
+   Returns ``True`` if reflection is disabled.
+
+   Will generally raise :exc:`NotImplemented` if executed on a 32-bit
+   Operating System.

这篇关于我怎样才能关闭注册表重定向Python的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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