The regGetSubKeys function returns the subkeys of a specified registry key on the local system or a remote system in an array. By default only the direct subkeys are returned. Optionally all subkeys can be retrieved recursively.
The function has the following syntax:
regGetSubKeys(sKey, fRecurse)
Specifies the registry key
Retrieves nested subkeys.
This function returns an array holding the names of the subkeys of sKey. An individual subkey name is returned as a relative path starting at sKey. The returned array can be passed regCreateSubKeys() to copy a subkey tree from one system to another.
If the function fails, it raises an exception.
Examples
Get subkeys of HKLM\Software\CA with error handling:
try { var arr, i, l; arr = regGetSubKeys("HKLM\\Software\\CA"); l = arr.length; for(i=0; i < l; i++) { ? arr[i] } } catch(e) { ? "Failure:", e }
Recursively get all subkeys of HKLM\Software\CA:
arr = regGetSubKeys("HKLM\\Software\\CA", true); l = arr.length; for(i=0; i < l; i++) { ? arr[i] }
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.
Copyright © 2013 CA. All rights reserved. |
|