Previous Topic: regCreateKey--Create a Registry Key (Function)Next Topic: regDeleteKey--Delete a Registry Key or a Key Hierarchy (Function)


regCreateSubkeys--Create Subkeys From an Array (Function)

The regCreateSubKeys function creates a key subtree under a given key from an array on the local system or a remote system. The array must contain the names of the keys to be created as relative path strings starting at sKey. regGetSubKeys() returns this type of array.

This function has the following syntax:

regCreateSubKeys(sKey, aSubKeys)
sKey

Specifies the registry key.

aSubKeys

Specifies the key subtree.

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

Examples

Create keys 'x', 'y' and 'z' under HKLM\Software\ACME:

regCreateSubKeys("HKLM\\Software\\ACME", ["x", "y", "z"]);

Create nested subkey tree:

regCreateSubKeys("HKLM\\Software\\ACME", ["a\b\c", "x\y\z"]);

Get subkey tree from remote system client8 and apply it to remote system client9:

arr = regGetSubKeys("client8::HKLM\\Software\\ACME", true);
regSetSubKeys("client9::HKLM\\Software\\ACME", arr);

Note: The key values must be handled separately.

See also:

regCreateKey--Create a Registry Key (Function)

regGetSubKey--Retrieve Sub Keys of a Registry Key (Function)