Skip to content

Reg_GetValueType

Gets the registry data type of the requested variable, for example REG_SZ or REG_DWORD.

Reg_GetValueType(sHandle, sKey, sVariable) as Boolean

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

Subkey path

Name of variable to check type of

The registry data type is stored in gsValue as text and in giValue as a number:

gsValue giValue
REG_SZ 1
REG_EXPAND_SZ 2
REG_BINARY 3
REG_DWORD 4
REG_MULTI_SZ 7
REG_QWORD 11

gbValue is TRUE if the type is found. If the variable doesn’t exist, gbValue is FALSE, gsValue is empty and giValue is -1. The function still returns TRUE.

If bStatus Then bStatus = Reg_GetValueType("HKLM", "Software\KeyName", "ValueName")
If bStatus Then bStatus = Job_WriteLog("Custom", "gsValue: '" & gsValue & "' giValue: '" & giValue &"'", bStatus, True)

Scripting Guidelines

Registry Functions Constants Package Property Variables