Reg2CI
Reg2CI copied to clipboard
Wrong conversion escaped doublequotes in reg file
[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.
My current workaround is to replace the following in this order at the generated PS-code
Replace: '" "`"
and then replace ' - `"" -
and then replace " `"
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\'
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 ...