Registry - Read value

Declaration

<AMREGISTRY ACTIVITY="read_value" KEY="text" VALUE="text" RESULTVARIABLE="text" />

Related Topics   

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. 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

\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.
  • Parameters containing user credentials, files, file paths, and/or other information specific to the task must be customized before the sample code can run successfully.

Description:

Read data from value "showtrayicon" in key "HKEY_LOCAL_MACHINE\SOFTWARE\Network Automation\Automate 10\TaskService" into variable "theVar".

<AMVARIABLE NAME="theVar" />

<AMREGISTRY ACTIVITY="read_value" KEY="HKEY_LOCAL_MACHINE\SOFTWARE\Network Automation\Automate 10\TaskService" VALUE="showtrayicon" RESULTVARIABLE="theVar" />