fresc81 / node-winreg

node module that provides access to the Windows Registry through the REG commandline tool
212 stars 58 forks source link

Error at SET if space in key or value #65

Open tripower opened 7 months ago

tripower commented 7 months ago

Hello

we get the following ERROR if a space is in the key or value of the set method ProcessUncleanExitError: ADD command exited with code 1: FEHLER: Ungültige Syntax. Geben Sie "REG ADD /?" ein, um die Syntax anzuzeigen.

method call: key.set("URL Protocol", WinReg.REG_SZ, '', (err)=> {
});

or

key2.set(WinReg.DEFAULT_VALUE, WinReg.REG_SZ, '"ExeFileFolder\ExeFileName" "--deeplink=%1"', (err)=> {
});

Info: it works on CMD ` C:>reg add HKCU\SOFTWARE\Classes\testKB /v "URL Protocol" /t REG_SZ /d "" /f Der Vorgang wurde erfolgreich beendet.

C:>reg query HKCU\SOFTWARE\Classes\testKB /v "URL Protocol" HKEY_CURRENT_USER\SOFTWARE\Classes\testKB URL Protocol REG_SZ `

update 1: key.set("\"URL Protocol\"",.. results in exteme cpu usage and forever running thread

update 2: version 1.2.4 works!!! (with pure NodeJS and in my electron v18 app) version 1.2.5 also NOT ok if I took the set method from 1.2.4 (very strange) so I do not close the issue because 1.2.5 should also work

andymartinwork commented 6 months ago

This happened to me too. 1.2.5 stopped working with this error:

ERROR: Invalid syntax. Type "REG ADD /?" for usage.

chunkbanned commented 5 months ago

I also have the same issue on 1.2.5, and when downgrading back to 1.2.4 it works perfectly fine with no issues. This message showed ERROR: Invalid syntax. Type "REG ADD /?" for usage.

jazpearson commented 5 months ago

Wow, me too. This is particularly nasty.