Loop - Values

Declaration

<AMLOOP ACTIVITY="values" KEY="text" RESULTDATASET="text">

Description: Loops through the values contained in a registry key and populates a dataset with results.

Practical Usage

Ideally used by administrators to registry management. They can use this activity to determine registry key values to perform operations on them using a variety of registry related activities, such as Rename value or Delete value.

General Parameters

Property

Type

Required

Default

Markup

Description

Registry key

Text

Yes

(Empty)

RESULTVARIABLE="varname"

The registry key that houses the values to loop.

Create and populate dataset

Text

Yes

No

ALLOWHIDDEN="yes"

The name of the dataset to create and populate with key value information.

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

Datasets

This activity creates a dataset with the following fields (assuming the name of the dataset is theDataset):

Name

Type

Return Value

thedataset.Name

Text

The value name (Example: REG_FULL_RESOURCE_DESCRIPTOR)

thedataset.Type

Text

The value type (Example: string, DWORD, QWORD).

thedataset.Data

Text

The value data. Such data depends on the value's name and type. Example:

  • Name: REG_RESOURCE_LIST

  • Type: String

  • Data: Text

Example

The sample AML code below can be copied and pasted directly into the Steps panel of the Task Builder.

Description: Loops through all values in key "HKEY_LOCAL_MACHINE\SOFTWARE\Google\Google Toolbar\Branding". Populates dataset "thedataset" with information. Displays the following information in a message box.

Value Name: %thedataset.Name%

Value Type: %thedataset.Type%

Value Data: %thedataset.Data%

<AMLOOP ACTIVITY="values" 
KEY="HKEY_LOCAL_MACHINE\SOFTWARE\Google\Google Toolbar\Branding" 
RESULTDATASET="thedataset"><AMSHOWDIALOG 
WINDOWTITLE="Registry Value Information" 
BUTTONS="ok_cancel" 
ONSECONDBUTTONCLICK="continue">Value 
Name: %thedataset.Name%
Value Type: %thedataset.Type%
Value Data: %thedataset.Data%</AMSHOWDIALOG>
</AMLOOP>