Skip to content

Registry Functions

The Registry category contains functions to create and manipulate Registry entries.

The sHandle parameter selects the registry hive. It accepts these values, which aren’t case-sensitive:

Short name Full name
HKLM HKEY_LOCAL_MACHINE
HKCU HKEY_CURRENT_USER
HKCR HKEY_CLASSES_ROOT
HKU HKEY_USERS
HKCC HKEY_CURRENT_CONFIG

Any other value makes the function return FALSE.

Functions that end in X64 always use the 64-bit registry view on 64-bit Windows, also when the script runs in a 32-bit process.

Functions without X64 use the registry view of the process that runs the script. In a 32-bit process on 64-bit Windows, Windows redirects some keys, such as HKLM\SOFTWARE, to HKLM\SOFTWARE\WOW6432Node.

All registry functions return TRUE if they succeed and FALSE if they fail. Functions that read from the registry store the result in global variables, such as gsValue, giValue, gaValue and gbValue. Each function page describes which variables the function sets.