winreg
(Windows Registry API) provides functions to expose the Windows Registry API to Python. We use this module to expose a low-level interface to the registry.
We use the method QueryValueEx
to access information such as the type
and data
components for a specified value name
. It is required that the value name associated with a key must be of an open key.
winreg.QueryValueEx(key, value_name)
key
: The handle which is returned by ConnectRegistry()
, including the constants in HKEY_USERS
or HKEY_LOCAL_MACHINE
.
value_name
: This refers to the value that we want to query in our keys.
This method returns a tuple containing the relevant items. At index 0
, the tuple contains the value of the specific registry item. At index 1
, the tuple contains the type of the specific registry item in the form of an integer value.
Free Resources