Hives are the main sections of the registry and all begin with the word HKEY. - HKEY_LOCAL_MACHINE - HKEY_CURRENT_USER - HKEY_USER
Keys are the folders in the registry. Keys can have many nested subkeys. Keys can have a value assigned to them under the (Default)
Values/Entries are name/data pairs. There can be many values in a key. The (Default) value corresponds to the Key, the rest are their own value pairs.
| depends: |
|
|---|
salt.modules.reg.Registry¶Delay '_winreg' usage until this module is used
salt.modules.reg.broadcast_change()¶Refresh the windows environment.
salt.modules.reg.delete_key_recursive(hive, key, use_32bit_registry=False)¶2015.5.4 新版功能.
Delete a registry key to include all subkeys.
| 参数: |
|
|---|
64bit installations. On 32bit machines this is ignored.
| 返回: | A dictionary listing the keys that deleted successfully as well as |
|---|
those that failed to delete. :rtype: dict
The following example will remove salt and all its subkeys from the
SOFTWARE key in HKEY_LOCAL_MACHINE:
CLI 范例:
salt '*' reg.delete_key_recursive HKLM SOFTWARE\salt
salt.modules.reg.delete_value(hive, key, vname=None, use_32bit_registry=False)¶Delete a registry value entry or the default value for a key.
| 参数: |
|---|
under the key. If not passed, the key (Default) value will be deleted.
| 参数: | use_32bit_registry (bool) -- Deletes the 32bit portion of the registry on |
|---|
64bit installations. On 32bit machines this is ignored.
| 返回: | Returns True if successful, False if not |
|---|---|
| 返回类型: | bool |
CLI 范例:
salt '*' reg.delete_value HKEY_CURRENT_USER 'SOFTWARE\Salt' 'version'
salt.modules.reg.read_value(hive, key, vname=None, use_32bit_registry=False)¶Reads a registry value entry or the default value for a key.
| 参数: |
|---|
under the key. If not passed, the key (Default) value will be returned
| 参数: | use_32bit_registry (bool) -- Accesses the 32bit portion of the registry |
|---|
on 64bit installations. On 32bit machines this is ignored.
| 返回: | A dictionary containing the passed settings as well as the |
|---|
value_data if successful. If unsuccessful, sets success to False :rtype: dict
If vname is not passed:
CLI 范例:
salt '*' reg.read_value HKEY_LOCAL_MACHINE 'SOFTWARE\Salt' 'version'
salt.modules.reg.set_value(hive, key, vname=None, vdata=None, vtype='REG_SZ', use_32bit_registry=False)¶Sets a registry value entry or the default value for a key.
| 参数: |
|---|
under the key. If not passed, the key (Default) value will be set.
| 参数: |
|---|
64bit installations. On 32bit machines this is ignored.
| 返回: | Returns True if successful, False if not |
|---|---|
| 返回类型: | bool |
CLI 范例:
salt '*' reg.set_value HKEY_LOCAL_MACHINE 'SOFTWARE\Salt' 'version' '2015.5.2'