|
Action |
Loads a registry key (including its subkeys and values) from a file.
|
Syntax |
LOADKEY ("subkey", "file name")
|
Parameters |
Subkey
The subkey in which you want to load the information. This subkey must exist for the call to be successful.
File name
Identifies the file from which to import the information. This file must be a valid registry hive file created by using the SAVEKEY function, or by using a registry editor.
|
Remarks |
On Windows NT or higher, using LOADKEY requires Backup and Restore privileges.
|
Caution |
LOADKEY imports information into the registry and overwrites any existing subkey. This replaces all the subkeys and values that may already exist in the subkey you are loading. Any existing values and subkeys are lost.
|
Returns |
|
0 |
Subkey loaded |
|
Error code |
Function failed |
|
Example |
$ReturnCode = LoadKey("HKEY_CURRENT_USER\KiXtart", "c:\temp\tst.reg")
If $ReturnCode = 0
?
"Key loaded...."
Endif