Command Reference

Modify Registry

Modifies the Registry.

Action ID: 17
Action Category: Registry

Settings

Registry action

The action to perform on the Registry:

Main key

The main or "root" key to modify.

Sub key

The sub key to modify.

Value name

The name of the Registry value to modify.

Value Type

The type of Registry value to write. Choose from REG_BINARY, REG_DWORD, REG_EXPAND_SZ, REG_MULTI_SZ, REG_SZ.

Value data

The data to write to the Registry value.

Note: If you are using REG_BINARY, you must enter the data as two-character hex values separated by spaces. For example, "A2 FF 00 B6". If you are using REG_MULTI_SZ, separate strings with the "|" symbol. For example, "Value 1|Value 2|Value 3".

Return Values

Value
(%LastErrorNum%)

Simple Message
(%LastErrorMsg%)

Verbose Message
(%LastErrorDetails%)

0 (OK)

 

 

1

Could not modify the Registry.

Could not create key.
<<MAIN_KEY\SubKey>>

2

Could not modify the Registry.

Could not delete key.
<<MAIN_KEY\SubKey>>

3

Could not modify the Registry.

Could not set value.
<<MAIN_KEY\SubKey - ValueName = ValueData>>

4

Could not modify the Registry.

Could not delete value.
<<MAIN_KEY\SubKey - ValueName>>

5

Could not modify the Registry.

Could not open key.
<<MAIN_KEY\SubKey>>

Example

In this example we will create a Registry key that tells the system to run "My Program.exe" whenever the system is rebooted.

Registry Action: Set Value
Main Key: HKEY_LOCAL_MACHINE
Sub Key: Software\Microsoft\Windows\CurrentVersion\Run
Value name: My Program
Value type: REG_SZ
Value data: %AppDir%\My Program.exe

 

See Also: Alphabetical List of Actions, Categorical List of Actions, On Error tab