Write-RegistryValue

Changes or adds a string value in the registry, existing entries in the registry are updated.


Settings:

  • Key
    Select the key in which a value is to be set. Variables are allowed. Use the "..." button to select an existing key (on the packaging system) or enter the key manually.
  • Value name
    Optionally the default value of the key or the name of another value.
    • Default value
      Click this radio button to change the default value in the specified key.
    • Radio button 
      Select an existing value (on the packaging system) from the drop-down list or enter the value name manually.
  • Value
    The string value to be set. The action is used to specify how the value is to be set (replace, delete, add or insert). 
  • Save as REG_EXPAND_SZ in the registry
    Stores the value as an expandable string in the registry.
  • Use 32-Bit mode on x64 computer
    If the script runs on a 64-bit operating system, referencing the HKEY_LOCAL_MACHINE\SOFTWARE key allows the 32-bit application counterpart HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node to be used automatically.
  • Action
    Defines how to handle the contents of a possibly existing value
    • Replace existing value
      The content is set to the specified value and any existing value is overwritten.
    • Delete value from existing line
      If the value already exists in the existing string, it is removed.
    • Add value to the end of existing line
      The specified value is appended to any existing line.
    • Insert value at the beginning of existing line
      The specified value is inserted at the beginning of any existing line.
    • Also add or insert value if it already exists in the line
      Determines whether the specified value is inserted even if it already occurs in the existing content (only valid for the options "Add value to the end of existing line" and "Insert value at the beginning of existing line")


Example:

The following example sets the column widths for the WinMerge application view in the registry of the current user:


Corresponds to DSM eScript command:

  • RegModify


See also: