1

I'm organizing my context menu for compiled binary tools and I wanted to use an ampersand (&) in one of the labels but nothing I have tried seems to work. I don't alter strings in the regisrty often and trying some of what I already know has not worked so far. I have tried the following:

^&
\&
\\&
@"Obfuscation & Packing"
&

I'm not clear on what form of syntax the registry uses, it seems to be it's own thing compared to everything else I have worked with. How do I properly escape this character in a registry string?

enter image description here

1 Answer 1

5

REG_SZ strings are just strings. They don't have anything that needs escaping.

Menu items are where the & character becomes special. In menu item titles, it indicates that the following letter will become the keyboard shortcut (mnemonic) – e.g. Ob&fuscation will make the F key select the menu item, and the letter f will be underlined.

To escape the ampersand in menu items, it has to be doubled, e.g. Obfuscation && Packing.

1
  • Thank you for the answer and explanation. This got the job done, thanks again. Dec 31, 2021 at 23:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .