PDA

View Full Version : Trying to put a '%' in a registry value



Adam Shaw
04-01-2021, 11:45 AM
I am trying to put a string into a registry value with the 'Create/Update Key and Value' command and running into problems.
I have a string ("C:\Program Files (x86)\Some.exe" Parm1 "%1") that keeps throwing a syntax error.
GEN1077 Syntax Error (1)
Is there any way to escape this percent sign, or another method to achieve my goal?
Thank you!

Adam Shaw
04-01-2021, 12:03 PM
I am trying to put a string into a registry value with the 'Create/Update Key and Value' command and running into problems.
I have a string ("C:\Program Files (x86)\Some.exe" Parm1 "%1") that keeps throwing a syntax error.
GEN1077 Syntax Error (1)
Is there any way to escape this percent sign, or another method to achieve my goal?
Thank you!

I had a colleague tell me, it's 2 percent signs: %%

linder
04-02-2021, 10:35 AM
Thanks for the update. Yes, %% is the correct way to handle this.

Friedrich