Create fixlet to insert " quotation marks " around selected path

Greetings all,

With the fixlet debugger, I have displayed the Path of an item in the registry… for example

Q: (value “Path” of it) of key “HKLM\SOFTWARE\MozillaPlugins@adobe.com/FlashPlayer” of registry
A: C:\WINDOWS\SysWoW64\Macromed\Flash\NPSWF32_25_0_0_127.dll

What I am attempting to do is:
(1) Verify if " " are at the beginning and end of stated Path
(2) if " " are not at beginning and end of Path, create a fixlet to insert them… so the result looks like this:
“C:\WINDOWS\SysWoW64\Macromed\Flash\NPSWF32_25_0_0_127.dll”

Thanks in advance

1 Like

So I created a fake registry key and value.
[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\BigFix\temp] "path"="\"HERE IS THE PATH\""

Relevance to verify if the 1st and last character are a quote is below. This would be placed in a fixlet

not (first 1 of it="%22" and last 1 of it="%22") of (it as string as trimmed string) of value "path" of key "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\BigFix\temp" of registry

The action script would look like this.
regset "[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\BigFix\temp]" "path"="{(if (last 1 of it="%22") then (substring before "%22" of it) else it) of (if (first 1 of it="%22") then (substring after "%22" of it) else it) of (it as string as trimmed string) of value "path" of key "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\BigFix\temp" of registry}"

Does that look right-ish?
-jgo

I will give it a try… thanks

Do please let us know…I wasn’t sure how the regset command would deal with quotes within the string. Since this should evaluate as
regset [HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\BigFix\temp]" “path”="“the path”"

I think this should evaluate to everything that is not the first or last character, if they are a %22.On mines it looks like this : regset [HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\BigFix\temp]" "path"="the path"