Previous Topic: regIsVal--Check the Existence of a Registry Value (Function)Next Topic: regSetVal--Set Registry Value (Function)


regSetKeyValues--Set Registry Key Values From an Array (Function)

The regSetKeyValues() function creates or sets values for a key from a two-dimensional array on the local or a remote system. Each top-level element in the array must contain a sub-array with a string representing the name of the value, a polymorphic JavaScript value to set, and optionally, an integer specifying the type of the value to create or set. regGetKeyValues() returns this type of array.

The function has the following syntax:

regSetKeyValues(sKey, aVals)
sKey

Specifies the registry key.

sVals

Defines the array that contains the values.

If the function fails, it raises an exception. Otherwise it returns true.

Examples

Set values 'Number' and 'Label' for HKLM\Software\ACME:

vals = [["Number", 42],["Label", "Hello"]];
regSetKeyValues("HKLM\\Software\\ACME\\Settings", vals);

Set values explicitly specifying type:

vals = new Array(2);
val[0] = ["MyPath", "%Path%;c:\\MyDir", REG_EXPAND_SZ];
val[1] = ["Number", 42, REG_DWORD];
regSetKeyValues("HKLM\\Software\\ACME\\Settings", vals);

Get values from remote system client8 and apply them to remote system client9:

arr = regGetKeyValues("client8::HKLM\\Software\\ACME\\Settings");
regSetKeyValues("client9::HKLM\\Software\\ACME\\Settings", arr);

See also:

regGetKeyValues--Get Registry Key Value Information (Function)

regSetVal--Set Registry Value (Function)