How do you escape quotes in action script?

(imported topic written by macook91)

Hello,

I am trying to use actionscript to put a value into the registry. I think if I new how to properly escape the " character in action script, then I’d be fine. I have tried " and %22 with no luck.

I am trying to take a registry file that adds a custom right click option to the BigFix Console and work it into a fixlet…

This my old .reg file that I could run and would work fine.

HKEY_CURRENT_USER\Software\BigFix\Enterprise Console\Settings\ComputerListContextMenuExtensions\remoteassistance

“MenuDisplayName”="&ANTS Windows Remote Assistance"

“MaxComputerSetSize”=dword:00000001

“ComputerApplicabilityRelevance”="( exists property result whose (name of property of it = “Remote Assistance Offering - Enabled Status” AND value of it = “Enabled”) of current computer )"

“ShellCommandRelevance”="“C:\windows\PCHEALTH\HELPCTR\Binaries\HelpCtr.exe -url %22hcp://CN=Microsoft Corporation,L=Redmond,S=Washington,C=US/Remote Assistance/Escalation/Unsolicited/RemoteAssistance.htm?” & ( value of property result whose (name of property of it = “IP Address” ) of current computer ) & “%22"”

I am trying to translate that into action script…

THIS KEY WORKS FINE

regset “” “MenuDisplayName”="&ANTS Windows Remote Assistance"

THIS KEY WORKS FINE

regset “” “MaxComputerSetSize”=dword:00000001

THIS KEY FAILS

regset “” “ComputerApplicabilityRelevance”="{escapes of “( exists property result whose (name of property of it = “Remote Assistance Offering - Enabled Status” AND value of it = “Enabled”) of current computer )”}"

THIS KEY FAILS

regset “” “ShellCommandRelevance”="{escapes of “C:\windows\PCHEALTH\HELPCTR\Binaries\HelpCtr.exe -url “hcp://CN=Microsoft Corporation,L=Redmond,S=Washington,C=US/Remote Assistance/Escalation/Unsolicited/RemoteAssistance.htm?” & ( value of property result whose (name of property of it = “IP Address” ) of current computer ) & “””}"

(imported comment written by JasonHonda)

I believe you may have two issues here. One is going to be that ‘escapes of’ operator does not work in session relevance from what I can see. The second is %22 should work for escaping quotes within in a string. Maybe you were not seeing this work because of the ‘escapes of’ not working.

(imported comment written by macook91)

jason_honda

I believe you may have two issues here. One is going to be that ‘escapes of’ operator does not work in session relevance from what I can see. The second is %22 should work for escaping quotes within in a string. Maybe you were not seeing this work because of the ‘escapes of’ not working.

I tried it without the escapes of, still no joy.

(imported comment written by JasonHonda)

So looking at what registry values you were trying to set, I have the following for the last two.

regset “” “ComputerApplicabilityRelevance”="{"( exists property result whose (name of property of it = %22Remote Assistance Offering - Enabled Status%22 AND value of it = %22Enabled%22) of current computer )"}"

AND

regset “” “ShellCommandRelevance”="{"%22C:\windows\PCHEALTH\HELPCTR\Binaries\HelpCtr.exe -url %2522hcp://CN=Microsoft Corporation,L=Redmond,S=Washington,C=US/Remote Assistance/Escalation/Unsolicited/RemoteAssistance.htm?%22 & ( value of property result whose (name of property of it = %22IP Address%22 ) of current computer ) & %22%2522%22"}"

That should at least get you exactly what you had in your registry from using a .reg file it would seem to me.