Closed alexcroox closed 9 years ago
Ah my fault, putValue has to have a string for the path (even though keyPath
in my example is a string).
regedit.putValue({
'HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System': {
worked for me
For clarification if anyone gets this error it is because you tried to set key of a JSON object with a variable
var registryKey = 'HKCU\\SOFTWARE\\myApp';
regedit.putValue({ registryKey: { ... });
which would generate JSON object:
{ registryKey: { .... } }
if you want to have your registry key to get value for registry key from a config of some sort, do this (ES6):
var registryKey = 'HKCU\\SOFTWARE\\myApp';
const registryValue = {[registryKey]: {
key: {
value: 1,
type: 'REG_DWORD',
},
}};
regedit.putValue(registryValue);
So I have the following in an attempt to allow Windows 8 to auto start a nodewebkit app that has to run in sysadmin mode (not without asking the user first and warning them of the risks of course...)
And the putValue() errors out with
code: 25122 message: "unsupported hive"
I know the path is correct because it correctly reads the value of it before it tries to modify it.