Create Registry Key VI

Owning Palette: Windows Registry Access VIs

Requires: Base Development System (Windows)

Creates a key in the Windows registry or opens it, if it already exists.

Caution  Incorrectly modifying the registry can damage Windows or prevent you from starting Windows.

Example

 Add to the block diagram  Find on the palette
machine is the name of the networked machine. The default is the local machine.
options is special options for the key.

0REG_OPTION_NON_VOLATILE
1REG_OPTION_VOLATILE
2REG_OPTION_BACKUP_RESTORE
root key is the Windows registry root key.

0HKEY_CLASSES_ROOT
1HKEY_CURRENT_USER
2HKEY_LOCAL_MACHINE
3HKEY_USERS
4HKEY_PERFORMANCE_DATA
5HKEY_CURRENT_CONFIG
6HKEY_DYN_DATA
subkey is the name of a subkey of root key. A beginning backslash character \ might cause an error.
security access mask is the access rights to assign the key.

0KEY_QUERY_VALUE
1KEY_SET_VALUE
2KEY_CREATE_SUB_KEY
3KEY_ENUMERATE_SUB_KEYS
4KEY_NOTIFY
5KEY_CREATE_LINK
6KEY_READ
7KEY_WRITE
8KEY_ALL_ACCESS
9KEY_READ | KEY_WRITE
error in describes error conditions that occur before this node runs. This input provides standard error in functionality.
class specifies the class (object type) of the key.
registry view specifies whether to create a 32-bit key or a 64-bit key on a 64-bit operating system.

0Default (default)—LabVIEW selects the type of key based on the version of LabVIEW that is installed. For example, if LabVIEW (64-bit) is installed, LabVIEW creates a 64-bit key.
8KEY_WOW64_32KEY—Creates a 32-bit key.
9KEY_WOW64_64KEY—Creates a 64-bit key.
refnum out is a handle to the open key.
action taken is the action taken by the VI.

0Unknown
1REG_CREATED_NEW_KEY
2REG_OPENED_EXISTING_KEY
error out contains error information. This output provides standard error out functionality.

Example

Refer to the Windows Registry Manipulation VI in the labview\examples\Connectivity\Windows Registry Access directory for an example of using the Create Registry Key VI.

 Open example  Find related examples