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
279 stars 45 forks source link

deleteValue #61

Closed JasminDreasond closed 3 years ago

JasminDreasond commented 5 years ago

I'm trying to create the function to delete a value from a key. But exist a problem :c vbscript process reported unknown error code 1

This script inside the regUtil.vbs not working. (I created the function)

Function RemoveValue(constHive, strSubKey, strValueName)        

    RemoveValue = DeleteValue(constHive, strSubKey, strValueName)

End Function

The variables "constHive", "strSubKey", "strValueName" is working. The problem is the DeleteValue() only.

The commit: https://github.com/JasminDreasond/node-regedit/commit/2075afed6fba48f053f291487ed81bb8e7a23c9c https://github.com/JasminDreasond/node-regedit/commit/4e3a8e93424a63dc4d4fec7aa34c4b14e972c1a1

Connum commented 5 years ago

Any progress on this? I need to delete a value as well, but this functionality is still listed as "TODO".

lhjt commented 4 years ago

I don't think that the DeleteValue function has been created. Is there a status update on when this feature will be introduced?

mollerzhu commented 4 years ago

I also try to fix this function but failed. Then I use node-exec to solve it.. The example is:

var shell = require('node-exec');

function deleteMyValue(key, value) {
    query = 'REG DELETE "' + key + '" /v ' + value + ' /f';
    shell.run(query).then(function(res) {
        console.log('delete success');
    });
}

deleteMyValue(regKey, regValue);
mollerzhu commented 4 years ago

@JasminDreasond I hope it will help some one.