setRegistryValue() / set64BitRegistryValue()
IMPORTANT Certain registry locations require 64-Bit Commands for 64-bit Windows machines.
Writes data to the specified registry value. This function takes three parameters:
- Enter the full path to a registry key containing a value
- Specify the
(Default)
value for a registry key by adding a trailing backslash\
. Otherwise specify a name for an existing value or to create a new value. See theName
column in image below.
Example of setting the(Default)
value:HKEY_LOCAL_MACHINE\SOFTWARE\000Sample\
- The last single backslash in a string is used to delimit the registry key from the registry value. To include backslashes as part of the value string, specify double slashes for each slash character. For example, the string
HKEY_LOCAL_MACHINE\SOFTWARE\SomeKey\Value\\Name
is interpreted as the keyHKEY_LOCAL_MACHINE\SOFTWARE\SomeKey
with a value ofValue\Name
.
- Specify the
- Enter the data to write to the registry value
- Select the data type
REG_SZ
- String value.REG_BINARY
- Binary data displayed in hexadecimal format. Must be entered in decimal format.REG_DWORD
- Binary data limited to 32 bits. Must be entered in decimal format.REG_EXPAND_SZ
- An "expandable" string value holding a variable. Example: %SystemRoot%.REG_MULTI_SZ
- A multiple string array. Used for entering more than one value, each one separated by a\0
string. Use\\0
to include\0
within a string array value.
NOTE On 64-bit machines the example image above requires set64BitRegistryValue() because of the registry location.
Example
setRegistryValue("HKEY_CURRENT_USER\KaseyaAgent-HKCUTest\TestDirectoryPath", "c:\temp", "REG_SZ", "All Operating Systems", "Halt on Fail")