Regset issue with HKCU

(imported topic written by ahermance91)

Hello Fellow BigFixians,

I am having an issue trying to set following current_user key to look like the following:

regset “” “OPEN”="/R “C:\Program Files\Microsoft Office\OFFICE11\Library\Analysis\ANALYS32.XLL”

Basically, I need a string value that has a name of “OPEN” and a value of "/R “C:\Program Files\Microsoft Office\OFFICE11\Library\Analysis\ANALYS32.XLL”

If you try the above regset with a value of “OPEN”=“I hate Excel”, it wil create it everytime, but there seems to be an issue with the slashes and quotes that is preventing BigFix from setting the HKCU key that I need set. I tried using an appendfile script as well and that didn’t help, or it’s more likely that I didn’t do it right. Using this regset has got me the closest to what I need to get to do. Please help!!!

(imported comment written by BenKus)

Hi ahermance,

The Windows Registry requires that backslashes be escaped with another backslash ("\") for the string value (not for the key names though).

Try this:

regset “” “OPEN”="/R “C:\Program Files\Microsoft Office\OFFICE11\Library\Analysis\ANALYS32.XLL”

OR

We built a BigFix relevance command

escape of

to do the same thing… you can try this too:

regset “” “OPEN”="/R “{escape of “C:\Program Files\Microsoft Office\OFFICE11\Library\Analysis\ANALYS32.XLL”}”

Ben

(imported comment written by ahermance91)

Ben,

Here’s what we’ve come up with to help resolve this issue, however I still need the parentheses around the “C:\Program Files\blah\blah\blah” in the registry. I’ve tried several different ways to get the parentheses, but it just isn’t working. Any and all help is certainly well appreciated!!!

regset “” “OPEN”="{escape of ("/R"&" " &""& “C:\Program Files\Microsoft Office\OFFICE11\Library\Analysis\ANALYS32.XLL”)}"

Thanks!!

(imported comment written by BenKus)

You need parenthesis around the path? or quotes? I will assume you mean quotes…

You can do it two ways:

  1. Use an escaped quote in the registry (")

  2. Use an escaped quote as part of your relevance (which is percent encoded: %22) and the “escapes of” will quote it automatically:

regset “” “OPEN”="/R “{escape of (”%22C:\Program Files\Microsoft Office\OFFICE11\Library\Analysis\ANALYS32.XLL%22")}"

Alternate option:

regset “” “OPEN”="/R “{escape of “C:\Program Files\Microsoft Office\OFFICE11\Library\Analysis\ANALYS32.XLL”}”"

In cases like these when you are trying to figure out registry syntax, it often helps to export the registry key using regedit and look at the export in a text editor.

Ben