@REGCREATE[HKEY...\subkey]: Create a new registry subkey. The parameter starts with the root key, which can be abbreviated:
Full root key | Short |
HKEY_CLASSES_ROOT | HKCR |
HKEY_CURRENT_USER | HKCU |
HKEY_LOCAL_MACHINE | HKLM |
HKEY_USERS | HKU |
HKEY_CURRENT_CONFIG | HKCC |
The remainder of the parameter (after the backslash) specifies the new subkey. The entire name must be quoted if it contains any white space or special characters, for example:
@REGCREATE["HKLM\Software\My Company\My Product\User"]
REGCREATE will create any intermediate keys necessary. For example, @REGCREATE[HKCU\key1\key2\key3] will create all three keys (if they do not already exist). REGCREATE returns 0 if the subkey was created or the Windows error number if an error occurred.
If the key name begins with \\machinename, @REGCREATE opens the registry on a remote machine. The remote registry service must be running on the remote machine, and you must have access and permissions. The HKEY parameter can be one of the following keys:
HKEY_CLASSES_ROOT (or HKCR)
HKEY_CURRENT_CONFIG (or HKCC)
HKEY_CURRENT_USER (or HKCU)
HKEY_LOCAL_MACHINE (or HKLM)
HKEY_PERFORMANCE_DATA (or HKPD)
HKEY_USERS (or HKU)
See also: @REGQUERY (read a value), @REGSET (write a value), and @REGSETENV (write and broadcast a value).