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.

IMPORTANT: Incorrectly editing the registry may severely damage your system. Before making changes to the registry, you should back up any valued data on your computer.

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

\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

Error Causes

On Error

Example

NOTE: 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" />