Previous Topic: regGetSubKey--Retrieve Sub Keys of a Registry Key (Function)Next Topic: regIsKey--Check the Existence of a Registry Key (Function)


regGetVal--Get Registry Value (Function)

The regGetVal function retrieves the setting of the value valName under the registry key specified by key on the local system or a remote system.

The function has the following syntax:

regGetVal(sKey, sValName)
sKey

Specifies the registry key.

sValName

Specifies the value.

If the specified value exists, the function returns a polymorphic value representing the setting of the specified value. The type of the registry value determines the type of the return value.

If the specified key or the value does not exist, the function raises an exception.

Examples

Get value named "Number" from key HKLM\Software\ACME:

regGetVal("HKLM\\Software\\ACME", "Number");

Get value named "Label" from key HKLM\Software\ACME with error handling:

try {
    regGetVal("HKLM\\Software\\ACME", "Label");
    ? "Success"
}
catch(e) {
    ? "Failure:", e
}

Get value from remote machine client8:

regGetVal("client8::HKLM\\Software\\ACME", "Name");

See also:

regGetKeyValues--Get Registry Key Value Information (Function)

regSetVal--Set Registry Value (Function)