Module basic module

Module registry

Windows Registry Access Module

Reference method:

1 2
var registry = require('registry'); var value = registry.get(registry.CLASSES_ROOT, "\node1\node2\value");

Static function

listSubKey

Return all sub-keys under the specified key value

1 2
static NArray registry.listSubKey(Integer root, String key);

Call parameters:

  • root : Integer, specify the registry root
  • key : String, specify the key value

Return result:

  • NArray , return all NArray keys under the key value

listValue

Returns the health of all data under the specified key

1 2
static NArray registry.listValue(Integer root, String key);

Call parameters:

  • root : Integer, specify the registry root
  • key : String, specify the key value

Return result:

  • NArray , returns the health of all data under the key

get

Query the value of the specified key value

1 2
static Value registry.get(Integer root, String key);

Call parameters:

  • root : Integer, specify the registry root
  • key : String, specify the key value

Return result:

  • Value , returns the value of the specified key value

set

Set the specified key value to a number

1 2 3 4
static registry.set(Integer root, String key, Number value, Integer type = DWORD);

Call parameters:

  • root : Integer, specify the registry root
  • key : String, specify the key value
  • value : Number, specified number
  • type : Integer, specify the type, allowed types are DWORD and QWORD, the default is DWORD

Set the specified key value to a string

1 2 3 4
static registry.set(Integer root, String key, String value, Integer type = SZ);

Call parameters:

  • root : Integer, specify the registry root
  • key : String, specify the key value
  • value : String, specified string
  • type : Integer, specify the type, allowed types are SZ and EXPAND_SZ, the default is SZ

Set the specified key value to multiple strings

1 2 3
static registry.set(Integer root, String key, Array value);

Call parameters:

  • root : Integer, specify the registry root
  • key : String, specify the key value
  • value : Array, specify multi-string array

Set the specified key value to binary

1 2 3
static registry.set(Integer root, String key, Buffer value);

Call parameters:

  • root : Integer, specify the registry root
  • key : String, specify the key value
  • value : Buffer , specify binary data

del

Delete the value of the specified key value

1 2
static registry.del(Integer root, String key);

Call parameters:

  • root : Integer, specify the registry root
  • key : String, specify the key value

constant

CLASSES_ROOT

Registry root, which stores a detailed list of file types recognized by Windows, and associated programs

1
const registry.CLASSES_ROOT = 0;

CURRENT_USER

Registry root, which stores the information set by the current user

1
const registry.CURRENT_USER = 1;

LOCAL_MACHINE

Registry root, including information about the hardware and software installed on the computer

1
const registry.LOCAL_MACHINE = 2;

USERS

The registry root contains information about the user who uses the computer

1
const registry.USERS = 3;

CURRENT_CONFIG

Registry root, this branch contains the current hardware configuration information of the computer

1
const registry.CURRENT_CONFIG = 5;

SZ

Registry data type, string

1
const registry.SZ = 1;

EXPAND_SZ

Registry data type, extended string

1
const registry.EXPAND_SZ = 2;

DWORD

Registry data type, 32-bit value

1
const registry.DWORD = 4;

QWORD

Registry data type, 64-bit value

1
const registry.QWORD = 11;