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

Create folder/path if it doesn't exist #68

Closed ghost closed 2 years ago

ghost commented 4 years ago

Error: registry path does not exist

Got this error when I tried to put key value on ..\\Policies\\System, because Policies folder is empty. Is there a way to check if the folder/path existed and if no, create it?

kessler commented 4 years ago

for now you'll have to list it before to check. Might implement this in the future

kessler commented 2 years ago

@M1cr0M1nd following our discussion the other day I checked and we are not lazily creating new paths in the registry if they are missing. Also, the underlying vbs registry api does not provide a flag or some other way to do this lazily and I don't think it make sense to implement this in our VBS layer of JS layer as default behavior of putValue.

We might consider have a separate function for this, eg: putOrCreateValue or something along these lines, but we should really see if there's a demand for this at all...