RegExistValue

Checks whether a value for a registry key exists.

Syntax:

RegExistValue(handle, subkey-string [,view-flag])

Parameters:

(i) handle handle to a registration database key.

(s) subkey-string a path from the key provided to the desired key, including the "data item name" in square brackets at the end of the key string.

(i) view-flag [optional] controls which registry view the function uses when accessing the Windows registry.
0 - view indicated by the last call to the RegOpenFlags.
32 - use the 32-bit registry view.
64 - use the 64-bit registry view.

 

Returns:

(i) This function returns @TRUE if the specified registry value (data item) exists and is accessible (i.e., can be read with RegQuery[..]). Otherwise, it returns @FALSE.

 

View-flag

This optional parameter controls which registry view the function uses when accessing the Windows registry. The optional parameter's values can be 32 to use the 32-bit view, 64 to use the 64-bit view, or 0 to use the view indicated by the last call to the RegOpenFlags. The parameter value of 0 can also causes a function to use the WinBatch default 64-bit view, if no call to RegOpenFlags has been made and setting the parameter to 0 is equivalent to omitting the parameter entirely.

Notes:

Example:


reg = RegExistValue(@REGMACHINE, "SOFTWARE\Wilson WindowWare\WinBatch\CurrentVersion")
If reg == 0
   Message("RegExistValue","The value doesn't exist?")
   Exit
EndIf
regkey = RegQueryValue(@REGMACHINE, "SOFTWARE\Wilson WindowWare\WinBatch\CurrentVersion[]")
Message("WinBatch directory", regkey)
See Also:

RegQueryValue and the section on Registration Database Operations