FAQ Database Discussion Community


Unable to import _winreg in Python 2.7.9 virtual environment

python,windows,google-app-engine,python-2.7,winreg
I'm running an app engine application in a virtual environment on windows 7 64bit, python 2.7.9 x64. Here's the stacktrace: p_system = platform.system() File "C:\Python27\lib\platform.py", line 1310, in system return uname()[0] File "C:\Python27\lib\platform.py", line 1206, in uname release,version,csd,ptype = win32_ver() File "C:\Python27\lib\platform.py", line 597, in win32_ver import _winreg File "C:\Program...

_winreg.SaveKey Error - A required privilege is not held by the client

python,registry,privileges,winreg
I want to save the registry key "Run" using _winreg in Python. This is my code: import _winreg key = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, r'Software\Microsoft\Windows\CurrentVersion\Run') _winreg.SaveKey(key, "C:\key.reg") When executing, I get a Windows error message: "A required privilege is not held by the client" Can anyone see what is wrong?...

Accessing winreg from jython

python,jython,winreg
Why can't access the _winreg module from jython? c:\>python Python 2.7.9 (default, Dec 10 2014, 12:24:55) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. import _winreg c:\>jython Jython 2.7b1 (default:ac42d59644e9, Feb 9 2013, 15:24:52) [Java HotSpot(TM) 64-Bit Server VM (Sun Microsystems Inc.)]...

How can I read a reg_qword in winreg in python 3.4?

python,windows,registry,python-3.4,winreg
I inserted a registry key, HKEY_LOCAL_MACHINE\SOFTWARE\test\test_qword of type REG_QWORD and value 20150509091344 (0x1253a7efba10). I then tried to load it using winreg with the following code in Python 3.4: import winreg key_dir = r"SOFTWARE\test" reg = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, key_dir, 0, winreg.KEY_WOW64_64KEY+winreg.KEY_ALL_ACCESS) test_dir = list(winreg.QueryValueEx(reg, r'test_qword'))[0] print(test_dir) ans = "".join(map(lambda b: format(b, "02x"),...