Including quotes in registry value using regset

(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 /port 4343

Failed attempt: regset "


" “SPath”="“C:\Program Files (x86)\Application\App\App.exe” /server /port 4343"

What should I be doing to get these quotes to be included here around the file path…?

(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 /port 4343”


(imported comment written by doubleminus91)


This gives me %22 on both sides of the path - they do not seem to translate into quotation marks…

(imported comment written by doubleminus91)

Note that I’ve also tried blackslashes for escaping quotes, double quotes, and some other tricks to no avail.

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