Loop - Values

Declaration

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

Related Topics   

Description

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

Practical Usage

Ideally used as a registry management tool by administrators that want to operate on a collection registry values or sub-keys, one at a time.

Parameters

General

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

Error Causes

On Error

additional Notes

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

NOTE: 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\ 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\ 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>