AnsweredAssumed Answered

Using the "Start System Process" operator when param has a space

Question asked by samuel.leibowitz on Jun 20, 2012
Latest reply on Mar 17, 2016 by Andy_Thompson
Hi folks,

I'm currently having a problem trying to execute a process on an agent host. I'm using the "Start System Process" operator in PAM 3.1 to start a silent run of Install Shield. The thing I'm trying to replicate from the command line looks like this:

C:\Program Files\long\boring\path>Installer.exe -s -f1"C:\Program Files\long\boring\path\install.iss"

So I have split this into two arguments, one containing the "-s", the other containing the "-f1" and the path to the install.iss file. The Javascript I'm using looks like this:
Process.PathToInstallISS = Process.InstallerLocation + "\\install.iss";
Process.InstallShieldArgument = "-f1\"" + Process.PathToInstallISS + "\"";
So the second argument in the PAM operator is just Process.InstallShieldArgument

The problem is that when this executes on the agent host, the temp script that it creates to execute the process contains the following:
cd /D C:\Program Files\long\boring\path
if not errorlevel 1 goto dirok
echo failed to switch to directory C:\Program Files\long\boring\path 1>&2
exit 121
set C2OSVD=c:\ca\temp_da\.c2otmp\12a064d1-f876-4bb1-8958-27481b1b567e\vars
set C2OULIB=C:\Program Files\CA\PAM Agent_DA\PAMAgent\.c2orepository\.c2ouserresources
call "Installer.exe" "-s" "-f1C:\Program" "Files\long\boring\path\install.iss"
set RC=%errorlevel%
if not %RC% == 1 goto exitok
So in short, I'm losing a quote character, and gaining an extra quote around the space between Program and Files.

Any advice on how I can get the operator to stop splitting this into multiple arguments at the space?