Skip to content

Reg_EnumKey

Enumerates the subkeys of a registry key. Only the direct subkeys are returned.

Reg_EnumKey(sHandle, sKey, bMustExist) as Boolean

Registry hive, for example HKLM. For all accepted values, see Registry Functions.

Subkey path

TRUE if the key must exist. If TRUE, the function also returns FALSE when the key has no subkeys.

The subkey names are stored in gaValue as an array. If the key doesn’t exist or has no subkeys and bMustExist is FALSE, gaValue is an empty array.

If bStatus Then bStatus = Reg_EnumKey("HKLM", "Software\KeyName", False)
If bStatus And IsArray(gaValue) Then
For index = LBound(gaValue) to UBound(gaValue)
bStatus = Job_WriteLog("Custom", "Index #" & index & ": " & cStr(gaValue(index)), bStatus, True)
Next
End If

Scripting Guidelines

Registry Functions Constants Package Property Variables