RegDeleteLink

Deletes a symbolic link key.

Syntax:

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

Parameters:

(i) handle an open registration database key (see below).

(s) subkey-string a path from the key provided to the desired key.

(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) @TRUE Key was deleted; @FALSE Key was not found.

 

The RegDeleteLink function deletes an existing symbolic link key from the Registration Database. If the key does not exist, RegDeleteLink will fail. When using RegDeleteLink you must pass a pre-defined keys @REGMACHINE, @RECLASSES, @REGUSERS, or @REGCURRENT  as the function's first parameter.  

Note: Using the RegDeleteKey function on a symbolic link key will delete the real registry key linked to the symbolic link key but will not delete the symbolic link key.

Caution: RegDeleteLink attempts to delete a regular registry key when the second parameter contains a regular key subkey path. However, RegDeleteKey should be used instead because the results from calling RegDeleteLink on a regular registration database key are unpredictable.

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:
  ;; Create a symbolic link
  LINK = 2  ; Symbolic link key
  hLink = RegCreateKeyEx(@regcurrent, 'Env', LINK, 0)
  
  ;; Associate the link with a real key
  TYPE = 6  ; A link's real key
  RegSetEx(hLink, '', '@REGCURRENT\Volatile Environment', '', Type , 0)
  
  ;; Close the link
  RegCloseKey(hLink)
  
  ;; Delete the link key. Note:Does not delete the real key
  Mode = ErrorMode(@off)
  RegDeleteLink( @regcurrent, 'Env', 0)
  ErrorMode(Mode)
See Also:

RegOpenKey, RegOpenKeyEx, RegCreateKey, RegCreateKeyEx, RegCloseKey, RegDeleteKey, RegDelValue and the section on Registration Database Operations