salt.modules.reg

Manage the registry on Windows

depends:
  • winreg Python module
class salt.modules.reg.Registry

Delay '_winreg' usage until this module is used

salt.modules.reg.create_key(hkey, path, key, value=None, reflection=True)

Create a registry key

CLI Example:

salt '*' reg.create_key HKEY_CURRENT_USER 'SOFTWARE\Salt' 'version' '0.97'
salt.modules.reg.delete_key(hkey, path, key, reflection=True)

Delete a registry key

Note: This cannot delete a key with subkeys

CLI Example:

salt '*' reg.delete_key HKEY_CURRENT_USER 'SOFTWARE\Salt' 'version'
salt.modules.reg.read_key(hkey, path, key, reflection=True)

Read registry key value

CLI Example:

salt '*' reg.read_key HKEY_LOCAL_MACHINE 'SOFTWARE\Salt' 'version'
salt.modules.reg.set_key(hkey, path, key, value, vtype='REG_DWORD', reflection=True)

Set a registry key vtype: http://docs.python.org/2/library/_winreg.html#value-types

CLI Example:

salt '*' reg.set_key HKEY_CURRENT_USER 'SOFTWARE\Salt' 'version' '0.97' REG_DWORD