kessler / node-regedit

Read, Write, List and do all sorts of funky stuff to the windows registry using node.js and windows script host
MIT License
277 stars 45 forks source link

making createKey/delete easier ? #4

Closed rafipiccolo closed 4 years ago

rafipiccolo commented 9 years ago

the syntax is a bit repetitive when you want to create a key and add something in it (especially a default value). cound you modify the createKey function to allow a value parameter ?

function regedit_createKey(key, value, callback) {
    regedit.createKey(key, function(err) {
            var obj = {};
            obj[key] = {
                '@': {
                   value: value,
                   type: 'REG_DEFAULT'
                }
            }
            regedit.putValue(obj, callback))
    });
}

Also, when you want to remove a key it fails with acces denied if there are other keys inside. would it be possible to just remove thoses keys recursively. I don't know how to do it, but maybe with list method ?

kessler commented 9 years ago

Excellent suggestions. I will try to implement soon