Previous Topic: qqout--Write Output to stdout (Function)Next Topic: regCreateSubkeys--Create Subkeys From an Array (Function)


regCreateKey--Create a Registry Key (Function)

The regCreateKey function creates a key or a key hierarchy under the registry key specified by sKeyParent on the local system or a remote system.

This function has the following syntax:

regCreateKey(sKeyParent, sKey)
sKeyParent

Specifies the parent key.

sKey

Defines the new key

If the function fails, it raises an exception. Otherwise it returns true. The function succeeds if the specified key or part of a key hierarchy exists.

Examples

Create key ACEM under the local machine SOFTWARE key with error handling:

try {
    regCreateKey("HKLM\\SOFTWARE", "ACME");
    ? "Success"
}
    catch(e) {
    ? "Failure", e
}

Create a key hierarchy:

regCreateKey("HKLM\\SOFTWARE", "ACME\\HOME");

Create key ACEM on remote machine client8:

regCreateKey("client8::HKLM\\SOFTWARE", "ACME");

See also:

regDeleteKey--Delete a Registry Key or a Key Hierarchy (Function)

regSetVal--Set Registry Value (Function)