Disable registry redirection to Wow6432Node in Python

后端 未结 1 1359
北荒
北荒 2021-01-25 07:43

I\'m trying to access registry keys under HKEY_LOCAL_MAHINE\\SOFTWARE... on a 64 bits system. I have following code but judging by the results it gets redirected to Wow6432Node

相关标签:
1条回答
  • 2021-01-25 08:16

    It looks like "_winreg.KEY_READ | _winreg.KEY_WOW64_64KEY" does the job. To be more precise you need to open the key this way:

    _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, "SOFTWARE", 0, _winreg.KEY_READ | _winreg.KEY_WOW64_64KEY)
    

    I got this working when accessing the localhost registry. However, I still haven't figured out how to connect to remote registry on the domain. Trying to use _winreg.ConnectRegistry, but keep getting access denied error.

    0 讨论(0)
提交回复
热议问题