registry Module
Read and write registry values in Novadesk.
The registry module is exported from the system module.
javascript
import { registry } from "system";Table of Contents
registry.readData(path, valueName)
Reads a registry value.
Parameters
path- Type:
string - Description: Full key path including hive (for example,
"HKEY_CURRENT_USER\\Software\\MyApp").
- Type:
valueName- Type:
string - Description: Registry value name.
- Type:
Return Value
- Type:
string | number | null - Description:
- Returns a
stringfor string values. - Returns a
numberfor numeric values. - Returns
nullif the value cannot be read or is unsupported.
- Returns a
registry.writeData(path, valueName, value)
Writes a registry value.
Parameters
path- Type:
string - Description: Full key path including hive.
- Type:
valueName- Type:
string - Description: Registry value name.
- Type:
value- Type:
string | number - Description: Value to write. Strings are written as string data; numbers are written as numeric data.
- Type:
Return Value
- Type:
boolean - Description:
trueif write succeeded; otherwisefalse.
Example
javascript
import { registry } from "system";
const ok = registry.writeData("HKEY_CURRENT_USER\\Software\\NovadeskDemo", "Opacity", 0.85);
console.log("write:", ok);
const value = registry.readData("HKEY_CURRENT_USER\\Software\\NovadeskDemo", "Opacity");
console.log("read:", value);