system
October 6, 2010, 4:05am
1
(imported topic written by doubleminus91)
I want to include a string when I set a registry value that has quotes inside of it.
Registry value name: SPath
String: “C:\Program Files (x86)\Application\App\App.exe” /server blah.com /port 4343
Failed attempt: regset "
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\service
" “SPath”="“C:\Program Files (x86)\Application\App\App.exe” /server blah.com /port 4343"
What should I be doing to get these quotes to be included here around the file path…?
system
October 6, 2010, 12:06pm
2
(imported comment written by SystemAdmin)
Replace the inner set of double-quotes with %22, so for the last part of your command string you would have:
“%22C:\Prog…App.exe%22 /server blah.com /port 4343”
-Jim
system
October 6, 2010, 8:30pm
3
(imported comment written by doubleminus91)
Jim,
This gives me %22 on both sides of the path - they do not seem to translate into quotation marks…
system
October 6, 2010, 11:47pm
4
(imported comment written by doubleminus91)
Note that I’ve also tried blackslashes for escaping quotes, double quotes, and some other tricks to no avail.
jhonda
October 7, 2010, 1:25am
5
(imported comment written by JasonHonda)
It looks like you were on the right track, but there is a limitation with regset when there are spaces within escaped quotes. What you’ll want to do instead is create a .reg file and then import it.