I am running the 64bit version of regedit and I can see the registry values, in Node.js I can get the path but there are no values listed, my code:
var fnList = (process.arch == "x64") ? regedit.arch.list64 : regedit.arch.list32;
const cstrLocation = "HKLM\SOFTWARE\MyCompany\ConfigFiles\";
fnList(cstrLocation, (err, results) => {
if ( err != null && typeof err == "object" ) {
console.log(consts.RED + "Registry key: " + cstrLocation);
console.log(err + consts.RESET);
console.dir(results[cstrLocation].values);
} else {
console.dir(results);
}
});
In the console I see all the keys but the object content is shown as:
{ exists: true, keys: [], values: {} }
Using regedit I can see there are 3 variables with data, why am I not getting these in node?
[Edit] I’ve also tried:
var fnList = (process.arch == "x64") ? regedit.arch.list64 : regedit.arch.list32;
const cstrLocation = "HKLM\SOFTWARE\MyCompany\ConfigFiles\";
fnList(cstrLocation).on("data", function(entry) {
console.dir(entry);
});
Same results…
2