Registry - Read value
Declaration
<AMREGISTRY ACTIVITY="read_value" KEY="text" VALUE="text" RESULTVARIABLE="text" />
Description: Retrieves the value associated with the specified name, in the specified registry key and populates a variable with the result.
Practical Usage
Used to read a single value from a registry key to obtain information about an application, user or system settings.
Resource Parameters
Property |
Type |
Required |
Default |
Markup |
Description |
---|---|---|---|---|---|
Registry key |
Text |
Yes |
(Empty) |
KEY="HKEY_CURRENT_USER\Software \NetAuto\AutoMate\\AMSERVICES" |
The registry key that should be acted on. Use the Folder icon to navigate to the desired registry key, value name and optionally, value data. |
Value name |
Text |
Yes |
(Empty) |
VALUE="Width" |
The registry value that should be read. |
Populate variable with value data |
Text |
Yes |
(Empty) |
RESULTVARIABLE="myvarname" |
The name of an existing variable to be populated with the value that is read from the registry. |
Description tab - A custom description can be provided on the Description tab to convey additional information or share special notes about a task step.
Error Causes tab - Specify how this step should behave upon the occurrence of an error. (Refer to Task Builder > Error Causes Tab for details.)
On Error tab - Specify what AWE should do if this step encounters an error as defined on the Error Causes tab. (Refer to Task Builder > On Error Tab for details.)
Example
The sample AML code below can be copied and pasted directly into the Steps panel of the Task Builder.
Description: Read data from value "showtrayicon" in key "HKEY_LOCAL_MACHINE\SOFTWARE\Network Automation\10\TaskService" into variable "theVar".
<AMVARIABLE NAME="theVar" /> <AMREGISTRY ACTIVITY="read_value" KEY="HKEY_LOCAL_MACHINE\SOFTWARE\Network Automation\10\TaskService" VALUE="showtrayicon" RESULTVARIABLE="theVar" />