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

If you pass undefined as value, it fails and the call back never gets called #48

Closed anaszgh closed 2 years ago

anaszgh commented 6 years ago

tValuesToPut[keyLocation].DefaultUserName = { value: username, type: 'REG_SZ' };

regedit.putValue(tValuesToPut, archConstant, function (err) { callback(err); });

in here the username was passed undefined, the put value function hanged and never returned to the call back.

after investigating the issue deeper, it appeared that when executing the csscript.exe to edit the registry, the process never ends and will stick on the task manager (this is the root cause of the problem, and when you kill the process the callback function get fired)

Platform: Windows 10 Environment: Electron Node Version: 6.11.2 Electron Version: 1.6.11