Registry Action


<AMREGISTRY ACTION="text [options]" TYPE="string" KEY="text" VALUE="text" VALUEDATA="text" RESULTVARIABLE="text">

See Also

Registry Action-Setting Properties Run, Send Keystrokes, DDE


Modifies the Windows Registry according to the settings you specify.

Be careful! Improper use of this action can cause irreversible damage to your operating system installation. Do not use unless you know what you are doing.

Practical Usage

Used to store, retrieve, modify or delete settings either for the task itself or for another application. For example, users may wish a task to save data collected during one session so that it can be retrieved and used the next time the task is run. In another possible use, users may wish to collect data about an external application by retrieving it from the applications registry branch. Using the HKEY_CURRENT_USER section of the registry is especially useful for storing "user-specific" data because each user on the Windows system has his/her own HKEY_CURRENT_USER structure that Windows loads in at log on, thus the data can be different depending on which user is logged on to the system. Use HKEY_LOCAL_MACHINE for settings that are not "user-specific" and are "global" to the machine. This action is intended for advanced users, improper use could damage your Windows installation and or the installation of other software on your system.


General Tab

Action to take

Options, Required
MARKUP: ACTION="write_value"

Specifies the action that the registry action should take.

The available options are:


Options, Required if ACTION="write_value"

Only used if the "Action to Take" [ACTION] parameter is set to Create\Change Value Data" [write_value] specifies the data type to use otherwise this parameter is not needed.

The available options are:

Registry Key

Text, Required
MARKUP: KEY="HKEY_CURRENT_USER\Software\Network Automation\AutoMate5\AMREGISTRY"

Specifies the registry key (folder) that should be acted upon. What takes place in the key depends on the "Action to Take" [ACTION] parameter.

Populate Variable with Value Data

Text, Required if ACTION="read_value"

Specifies the name of an already created variable which should be populated with the value that is read from the registry. This parameter is only valid if ACTION=read_value.

Value Name

Text, Required if ACTION="read_value,write_value,delete_value or rename_value"
MARKUP: VALUE="HKEY_CURRENT_USER\Software\Network Automation\AutoMate5\AMREGISTRY"

Specifies Registry value that should be acted upon. What takes place in on the value depends on the "Action to Take" [ACTION] parameter.

Value Data

Text, Required if ACTION="write_value"

Specifies the Registry value data to write. Valid only when the Create\Change Value Data is specified in the "Action to Take" [ACTION] parameter. The "Registry Key" and "Value Name" must also be specified for proper functioning.


Custom Description

This action includes the Description tab for entering a custom step description.

More on setting custom step description

Standard Error Handling Options

This action also includes the standard Error Causes and On Error failure handling options/tabs.

More on Error Handling Options

Variables and Expressions

All text fields allow the use of expressions, which can be entered by surrounding the expression in percentage signs (example: %MYVARIABLE%, %Left('Text',2)%). To help construct these expressions, you can open Expression Builder from these fields by pressing F2.

More on variables
More on expressions

More on the expression builder


NOTE: The code below can be copied and pasted directly into the Steps pane of the Task Builder.

<AMREGISTRY ACTION="read_value" KEY="HKEY_CURRENT_USER\Software\Network Automation\AutoMate5\AMREGISTRY" VALUE="Left" RESULTVARIABLE="variablename">

<AMREGISTRY ACTION="write_value" TYPE="string" KEY="HKEY_CURRENT_USER\Software\Network Automation\AutoMate5\AMREGISTRY" VALUE="Left" VALUEDATA="170">