reghelpers¶
- gonto.reghelpers.set_winreg_value(root: str, path: str | None, name: str, type_: str, data: Any) None¶
Creates a Windows registry key and value and set it to the given data.
- Parameters:
root –
Name of one of the
HKEY_*constant (e.g."HKEY_LOCAL_MACHINE").See: https://docs.python.org/3/library/winreg.html#hkey-constants
path – The path of the subkey (e.g.
"SOFTWARE\\Foobar").name – The name of the value (e.g.
"MyValue").type –
The type of the value (e.g.
"REG_SZ","REG_DWORD").See: https://docs.python.org/3/library/winreg.html#value-types
data – The data to put in the value.
- Raises:
ValueError – if an invalid root or type is provided.
WindowsError|OSError – if an error occurs when creating the key or the value.