Sets a value in the registry or associates a real key with a symbolic link key.
RegSetEx(handle, subkey-string, value, delimiter, type [,view-flag])
(i) handle an open registration database key (see below).
(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.
(s) value data to be stored in the database at desired key.
(s) delimiter a character to act as a delimiter between items. "Delimiter" is ignored unless "type" is 7.
(i) type see below.
(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.
(s) @TRUE data item value was stored.
"type" can be one of the following:
Value |
Meaning |
0 |
(REG_NONE) No defined value type |
1 |
(REG_SZ) Unicode null terminated string |
2 |
(REG_EXPAND_SZ) Unicode null terminated string (with environment variable references) |
3 |
(REG_BINARY) Free form binary |
4 |
(REG_DWORD) 32-bit number |
6 |
(REG_LINK) Use to associate a real registration database key with a symbolic link key (see below) |
7 |
(REG_MULTI_SZ) Multiple Unicode strings |
11 |
(REG_QWORD) 64-bit number |
Symbolic Links ("type" 6 - REG_LINK)
There are several special restrictions and requirements that apply only to using this option to complete the association of a real registration database key with a previously created symbolic link key:
The handle parameter must be a handle to a symbolic link returned by either RegCreateKeyEx using option 2 or RegOpenKeyEx using option 8.
The subkey-string parameter must be set to an empty string ("")
The value parameter must be the complete registration database path to the real key and must include one of the following for pre-defined keys: @REGMACHINE, @REGCURRENT, @REGUSERS, or @REGCLASSES at the beginning of the path string.
The view-flag parameter applies to the registration view of the value parameter path and not to the handle parameter as is the case with all other types.
Example: See the RegDeleteLink function's topic for a example of a registration database path for the value parameter as used with this option.
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:
Using the 32 or 64 values cause these functions to error if a function's subkey parameter contains the string 'wow6432node'.
Setting the parameter to one of the valid values has no effect when running on 32-bit Windows.
Windows Vista/2008 and newer: This function may require an Administrator level account, if it attempts to access protected registry keys: HKEY_LOCAL_MACHINE or HKEY_CLASSES_ROOT.
See the Registry Cloning Script under RegEntryType.
RegApp, RegEntryType, RegSetBin, RegSetDword, RegSetExpSz, RegSetMulSz, RegSetValue RegOpenKeyEx, RegCreateKeyEx, and the section on Registration Database Operations