Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong conversion escaped doublequotes in reg file #11

Open
ericvanvoorthuizen opened this issue Jan 12, 2022 · 3 comments
Open

Wrong conversion escaped doublequotes in reg file #11

ericvanvoorthuizen opened this issue Jan 12, 2022 · 3 comments

Comments

@ericvanvoorthuizen
Copy link

[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
Copy link
Author

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

Replace:
'"
"`"

and then replace
' -
`"" -

and then replace
"
`"

@gointern
Copy link

gointern commented Jul 27, 2022

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\'

@rzander
Copy link
Owner

rzander commented Aug 8, 2022

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 ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants