Reg2CI icon indicating copy to clipboard operation
Reg2CI copied to clipboard

Wrong conversion escaped doublequotes in reg file

Open ericvanvoorthuizen opened this issue 3 years ago • 3 comments

[HKEY_CURRENT_USER\Software\Classes\PDFXEdit.PDF\shell\Signal\shell\f_Help\command] @=""C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" "https://website.com/Site.aspx""

will be converted to

if((Test-Path -LiteralPath "HKCU:\Software\Classes\PDFXEdit.PDF\shell\Signal\shell\f_Help\command") -ne $true) { New-Item "HKCU:\Software\Classes\PDFXEdit.PDF\shell\Signal\shell\f_Help\command" -force -ea SilentlyContinue }; New-ItemProperty -LiteralPath 'HKCU:\Software\Classes\PDFXEdit.PDF\shell\Signal\shell\f_Help\command' -Name '(default)' -Value '"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" "https://website.com/Site.aspx' -PropertyType String -Force -ea SilentlyContinue;

original value is "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" "https://website/Site.aspx"

but will be after excuting PS

"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" "https://website.com/Site.aspx\

which is wrong.

ericvanvoorthuizen avatar Jan 12 '22 18:01 ericvanvoorthuizen

My current workaround is to replace the following in this order at the generated PS-code

Replace: '" "`"

and then replace ' - `"" -

and then replace " `"

ericvanvoorthuizen avatar Jan 12 '22 19:01 ericvanvoorthuizen

Got similar issue with:

` [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.zip\shell\open\command]

@=""C:\Program Files\7-Zip\7zFM.exe" "%1"" `

gets conversted to:

if((Test-Path -LiteralPath "HKLM:\SOFTWARE\Classes\7-Zip.zip\shell\open\command") -ne $true) { New-Item "HKLM:\SOFTWARE\Classes\7-Zip.zip\shell\open\command" -force -ea SilentlyContinue }; New-ItemProperty -LiteralPath 'HKLM:\SOFTWARE\Classes\7-Zip.zip\shell\open\command' -Name '(default)' -Value '\"C:\Program Files\7-Zip\7zFM.exe\" \"%1\' -PropertyType String -Force -ea SilentlyContinue;

value is wrong:

-Value '\"C:\Program Files\7-Zip\7zFM.exe\" \"%1\'

gointern avatar Jul 27 '22 14:07 gointern

It should be fixed in the current version Version 1.0.3.11, but I hope that it did not break other types of string ...

rzander avatar Aug 08 '22 09:08 rzander