Are you talking about Managed Scripts or Security and Patch Manager? Also, which version, and service pack? Be sure to use the Tags section in the first post to help.
8.8 SP3 and managed scripts.
From what I've seen and done, the "%programfiles%" variable does not work when called via a Remote Execute such as this
The only way I've done it, is via calling a VBScript that went to the location needed, or called the specific application.
strProgramFiles = CreateObject("WScript.Shell").ExpandEnvironmentStrings("%programfiles%")
Set WshShell = WScript.CreateObject("WScript.Shell")
rc = WshShell.Run("notepad.exe " & strProgramFiles & "\script.txt",, True)
' You can also run applications
' Remember that QUOTES are needed if the path contains a SPACE
rc = WshShell.Run("""" & strProgramFiles & "\Windows Media Player\wmplayer.exe" & """",, True)
Hope that points you in the right direction.