Registry.SetValue

Registry.SetValue ( 

number MainKey,

string SubKey,

string Value,

string Data,

number Type = REG_SZ )

Description

Sets the data of a specific Registry value.

Parameters

MainKey

(number) The main or "root" key containing the sub key. Choose from:

CONSTANT

VALUE

HKEY_CLASSES_ROOT

0

HKEY_CURRENT_CONFIG

1

HKEY_CURRENT_USER

2

HKEY_LOCAL_MACHINE

3

HKEY_USERS

4

SubKey

(string) The sub key containing the value.

Value

(string) The value whose data you want to set.

Note: To set the "(Default)" value, use an empty string "" as the value name.

Data

(string) The data you want to assign to the value.

Type

(number) The type of data you want to assign:

CONSTANT

VALUE

DESCRIPTION

REG_SZ

1

A null-terminated string. ("SZ" is short for "string, zero-terminated.")

REG_EXPAND_SZ

2

A null-terminated string that contains environment variables which are to be expanded whenever the Registry value is accessed.

REG_BINARY

3

Raw binary data. Visual Patch requires this data be passed as a string of hex values separated by single spaces. For example, 2C 00 00

REG_DWORD

4

A 32-bit number.

REG_MULTI_SZ

7

An array of null-terminated strings, each one terminated by two null characters. When storing multiple string values in one Registry value, Visual Patch requires that each string be separated by a "|" character. For example \Hey|\You.

Returns

Nothing. You can use Application.GetLastError to determine whether this action failed, and why.

See also:  Related Actions