Version: 3
restore

Contents

Method

RegistryEnumerateKeys

ModuleNativeServices
LibraryCore
Action

Enumerate the sub keys under a registry hive & key.

Parameters

Hive (string): The registry hive to place the SubKey parameter, has to match one of the following long or short names, ignoring case:

 

Long NameShort Name
HKEY_CLASSES_ROOTHKCR
HKEY_CURRENT_CONFIGHKCC
HKEY_LOCAL_MACHINEHKLM
HKEY_USERSHKU

Subkey (string): The registry key to look for.

Recursive (boolean; optional, default false): Whether to descend recursively or not.

Return values

If Hive does not exist then the result is InvalidParameter and this string:

    • Invalid registry hive name: <Hive>

If parameter Subkey is invalid structure then the result is ExecutionError and this string:

    • Invalid syntax

If parameter SubKey exists but cannot be opened by the agent (for any reason) then it is treated as though it does not exist.

If parameter Subkey does not exist then the result is SuccessNoContent.

Otherwise the results issued will have these columns:

    • Name (string): the full path of the keys found below the Subkey parameter supplied

    • DefaultValue (string): The string value assigned to the key if set (the value named "(Default)" in RegEdit), or "(value not set)" if not (like RegEdit).

The supplied key will appear in the results if it exists, regardless of whether or not it has child keys.

Example
 NativeServices.RegistryEnumerateKeys(Hive:"HKLM", Subkey:"software\\vendor", Recursive:true);
Platforms
  • Windows
Notes