Use of System Variables in Parameter

(imported topic written by d.limanov)

Hello,

I apologize if this is trivial, but I need to do few things with SEP client that requires “smc -stop” command being issued. I was hoping to do this using the following code:

parameter “smc” = “{pathname of file (value of variable “ProgramFiles” of environment & “\Symantec\Symantec Endpoint Protection\Smc.exe”)}”

run “{parameter “smc”} -stop”

However Fixlet Debugger reporting that "Command failed (parameter add failed) parameter “smc” = “C:\Program Files (x86)\Symantec\Symantec Endpoint Protection\Smc.exe”

If do a straight path instead of variable, it works, but I was wondering if there was a way to use variable for those cases where it may be an x64 machine. Is it possible to use system variable like this in parameter?

Thanks!

(imported comment written by d.limanov)

So it appears that parameter can be used only once per action within Fixlet Debugger, which means you have to close and re-open it every tme you make a change. Bummer.

(imported comment written by jgstew)

Once a parameter is set, it can never be changed. All parameters are set at the beginning of execution of the actionscript no matter where the parameter is within the actionscript.

It sounds like the debugger was having an issue thinking that the parameter was already defined and that was the reason it did not like it being changed again. It seems like the close/reopen is just making it forget the past context and allowing it to work.

If you use something like the following instead, you can avoid the need to worry about the correct program files path:

(value “InstallLocation” of key whose (value “DisplayName” of it as string contains “Symantec Endpoint Protection” AND value “DisplayVersion” of it as string as version >= “10.0.1” as version AND exists value “InstallLocation” of it) of key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of native registry as string)

so it would be:

parameter “smc” = “{pathname of folder (value “InstallLocation” of key whose (value “DisplayName” of it as string contains “Symantec Endpoint Protection” AND value “DisplayVersion” of it as string as version >= “10.0.1” as version AND exists value “InstallLocation” of it) of key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of native registry as string)}\smc.exe”

(imported comment written by d.limanov)

Thanks much, exactly what I was looking for!