Skip to main content
Actions

Set registry value

What the Set registry value action does, which types and value formats it supports, and when the step fails.

Set registry value writes a named value to the device's Windows registry. The device must be online.

Configuration fields

FieldTypeRequiredDefaultDescription
Key pathtextYes—Full path of an existing key. It starts with the complete hive name: HKEY_LOCAL_MACHINE, HKEY_CURRENT_USER, HKEY_USERS, HKEY_CLASSES_ROOT or HKEY_CURRENT_CONFIG, for example HKEY_LOCAL_MACHINE\SOFTWARE\Example. Short forms such as HKLM do not work. The step does not create missing keys. Supports variables ${{ … }}.
Value nametextYes—Name of the value. If it does not exist yet, it is created. You cannot set a key's unnamed default value. Supports variables.
TypeselectionYesString (REG_SZ)String (REG_SZ), Expandable string (REG_EXPAND_SZ), DWORD (32-bit), QWORD (64-bit) or Multi-string (REG_MULTI_SZ). Binary values are not supported.
ValuetextNoemptyThe data to write. Supports variables. Leading and trailing spaces are removed. The format depends on Type, see below.
TypeValue format
String (REG_SZ), Expandable string (REG_EXPAND_SZ)Any text. An empty value writes an empty string.
DWORD (32-bit)Whole number in decimal from -2147483648 to 2147483647. Hexadecimal such as 0x1 does not work.
QWORD (64-bit)Whole number in decimal from -9223372036854775808 to 9223372036854775807.
Multi-string (REG_MULTI_SZ)One entry per line. Empty lines are dropped.

Platform support

PlatformSupported
WindowsYes
LinuxNo
macOSNo

Outputs

OutputDescription
successSucceeded: true when the value was written, false when the device reported an error.

Result behaviour

The step writes the value with the Windows system account. So HKEY_CURRENT_USER is the system account's registry, not the signed-in user's. To change a signed-in user's settings, use a Run script step with Logged-in user instead.

SituationResult
The key exists and the value is writtenSucceeded. An existing value with the same name is overwritten, including its type.
DWORD (32-bit) or QWORD (64-bit) with a value that is not a whole number in rangeFailed
Key path or Value name is empty after variables are resolvedFailed
The key does not exist, or the hive name is not recognisedFailed. The step details show the reason.
Access to the key is deniedFailed
The device runs Linux or macOSFailed
The agent does not answer in timeTimed out. Whether the value was written is unknown.
The device is offline when the step startsDevice offline. Depending on If device is offline, the run ends with this status or the step is skipped.

Running the step again with the same settings writes the same value again and succeeds. Registry changes can affect applications and Windows itself, so test the step on a single device first.

See also: Create an automation · Registry Change