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.
WARNING: Incorrectly
editing the registry may severely damage your system. Do
not edit the Windows registry unless you are
confident about doing so.
Practical usage
Used to read a single value from a registry key in order to obtain information about an application, user or system settings.
Parameters
Resource
Property | Type | Required | Default | Markup | Description |
---|---|---|---|---|---|
Registry key | Text | Yes | (Empty) | KEY="HKEY_CURRENT_USER\Software\Fortra\Automate Desktop\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 to 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. |
Example
NOTE:
- Copy and paste the sample AML code below directly into the Task Builder Steps Panel.
- To successfully run the sample code, update parameters containing user credentials, files, file paths, or other information specific to the task to match your environment.
Description
This sample task reads a value from a registry key and populates a variable with value data.
Copy
<AMVARIABLE NAME="theVar" />
<AMREGISTRY ACTIVITY="read_value" KEY="HKEY_LOCAL_MACHINE\SOFTWARE\AutoMate\<Automate Desktop or Automate> <product version number>\TaskService" VALUE="showtrayicon" RESULTVARIABLE="theVar" />