Questions tagged [winreg]

_winreg is the python module for Windows registry access. This module provides a low-level interface to the Windows registry database. The interface directly mirrors the underlying Windows API.

_winreg (renamed to winreg in Python 3) is the python module for Windows registry access. The functions in this module expose the Windows registry API to Python. Rather than using an integer as the registry handle, a handle object is used to ensure that the handles are closed correctly, even if the programmer neglects to explicitly close them.

For a complete reference, please see the python documentation at docs.python.org.

160 questions
0
votes
1 answer

python: _winreg type name

Regarding Value Types: http://docs.python.org/2/library/_winreg.html#value-types How do I query _winreg.REG_BINARY for 'REG_BINARY'? I can do it manually with: import _winreg reg_type_str = { _winreg.REG_BINARY: 'REG_BINARY', …
VertigoRay
  • 5,935
  • 6
  • 39
  • 48
0
votes
1 answer

Python winreg missing subkey on Win7

I'm wondering why python module winreg doesn't return all the subkeys and values in Win7 host. If I use native reg cmdline command to query registry I get the following: >reg query…
Ray
  • 11
  • 1
  • 3
0
votes
1 answer

Cygwin Python Script using cygwinreg that can run on the Windows Python

Python newbie here. I am writing a simple script in Python, using the 2.7.3 distribution from Cygwin. I want to access/modify Windows Registry from this script. I found out that the _winreg module is not available on cygwin python but that an…
Miserable Variable
  • 28,432
  • 15
  • 72
  • 133
0
votes
2 answers

Reading a DWORD Date From Registry Using Python & _winreg

I'm trying to read a DWORD date from the Windows registry using Python's _winreg.QueryValueEx and I can't get the correct format. DWORD Value: 5116e300 Output using _winreg.QueryValueEx: 1360454400 Desired Output: 2/10/2013 Can I use datetime…
nicholaswilde
  • 101
  • 3
  • 10
0
votes
2 answers

Need help to set DWORD value with python

I am trying to set a DWORD value of 0xFFFFFFFF in Windows registry. But when I try this: _winreg.SetValueEx(aKey,"dword_test_2",0, _winreg.REG_DWORD, 4294967295L ) it throws an error: ValueError: Could not convert the data to the specified…
-1
votes
2 answers

I am getting error 2 in my winreg function

My code: HKEY hKey; char *path = "SYSTEM\\CurrentControlSet\\Control\\IDConfigDB\\Hardware Profiles\\0001\\HwProfileGuid"; LONG result = RegOpenKeyExA(HKEY_LOCAL_MACHINE, path, 0, KEY_ALL_ACCESS, &hKey); QString q = QString::number(result); if…
-1
votes
1 answer

Why do I get a ModuleNotFoundError for winreg on a Linux system?

'winreg' module is not found python 3.6.7. I am not facing this problem in Python 3.4. Is any third-party app in 'winreg' that I can use same code or how can I solve this. jaki@jaki-notebook:~$ python3 -V Python 3.6.7 jaki@jaki-notebook:~$…
Jaki
  • 137
  • 1
  • 3
  • 9
-1
votes
2 answers

Merge a .reg file via Python 2.7

I am looking for a simple way to merge a .reg file into the registry as part of my automated script in Python 2.7. I am rather lost on this issue and haven't found very much useful information. I can do this via a batch file, but when I call that…
Steve Smith
  • 168
  • 2
  • 10
-1
votes
1 answer

SyntaxError: invalid syntax

I'm not sure why I am getting an invalid syntax error on this. Does anyone have any ideas? import _winreg explorer = _winreg.OpenKey( _winreg.HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer" ) # list values…
-9
votes
2 answers

How place python app in startup?

I want place my python app in startup the windows. how i write code in python for this work? this app after complete with using py2exe convert to exe file. thanks.
Dekhia
  • 1
1 2 3
10
11