Contents

Method

RegistryGetValue

ModuleNativeServices
LibraryCore
Action

Get a registry value.

Parameters

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

Long NameShort Name
HKEY_CLASSES_ROOTHKCR
HKEY_CURRENT_CONFIGHKCC
HKEY_CURRENT_USERHKCU
HKEY_LOCAL_MACHINEHKLM
HKEY_USERSHKU

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

Name (string): The name of the registry value for which to get its value.

Return values

If the specified subkey and name exist, the call will return the following:

  • Name (string): The full path of the registry value.
  • ValueType (string): "REG_DWORD" etc. as appropriate.
  • Value (string): The actual value of an appropriate type, converted to a string if not one already.

If the specified subkey or name does not exist, the call will not return anything but does not return an error ("success, no content").

Example
 NativeServices.RegistryGetValue(Hive:"HKLM", Subkey:"software\\vendor", Name:"value23");

The Name returned for this is "HKLM\software\vendor\value23".

Platforms
  • Windows
Notes

From v4.1, REG_MULTI_SZ values are displayed with a '|' between each string; up to v4.0 only the first string was displayed.

REG_NONE keys are not supported.

To get a registry value for every user under HKU, use NativeServices.RegistryGetUserValues.