I'm trying to create a key like this
_winreg.CreateKey(_winreg.HKEY_LOCAL_MACHINE, 'Software\\Microsoft\\Shared Tools\\MSCONFIG\\startupreg\\test\\')
and the key is beeing created here
HKLM\Software\Wow6432Node\Microsoft\Shared Tools\MSCONFIG\startupreg\test\
why?
Yes, Windows 7 64x here
You can read the article Glenn referred to, but it will not be much help.
What you probably need is proper access rights combined with access to the 64-bit registry view:
with _winreg.CreateKeyEx(_winreg.HKEY_LOCAL_MACHINE,
r"Software\Microsoft\Shared Tools\MSCONFIG\startupreg\test\",
0,
_winreg.KEY_WOW64_64KEY | _winreg.KEY_ALL_ACCESS) as key:
_winreg.SetValueEx(key, "testValueName", 0, _winreg.REG_SZ, "value")
Please note the combination of those _winreg.KEY_WOW64_64KEY | _winreg.KEY_ALL_ACCESS.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With