TaskCentre "Run Program" - how are parameters handled?

I'm trying to use the "Run Program" Tool in a Task. I'm pointing it to an EXE file that takes two parameters: the first is a path to an XML file and the second is a key/value pair. From the command line, I call the program like this:

MyProgram.exe config.xml id=123

What is the equivalent in TaskCentre? I have the following configuration but it does not appear to work:

  • Program to Run: (the_path_to_the_exe)/MyProgram.exe
  • Parameters:
    • Name : configFile, Type : BSTR, Value : config.xml
    • Name : imisid, Type : BSTR, Value : id={Variables("IMISID")}  (attempting to format this so my program can interpret it correctly while also merging in a variable)

 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

From the online help for TaskCentre

Note: When defining pathnames to executables or files, ensure that the string is enclosed within double quotes. E.g. "C:\Program Files\MSOffice\Winword.exe". This also applies to any strings used for parameter information.

Ted Ericson. ASI/Product Management

 

Still not working with double quotes...

I went back into TaskCentre and wrapped the "Program to Run" path string in double quote and wrapped all parameters in double quotes. It still didn't fire. To go a step further, I hard-coded the parameters to values that I know would work. It still doesn't fire, even though the event log indicates that it was successful.

Then, I executed the program from the command line myself with the same parameters that I used in TaskCentre. I messed around with three different ways of using double-quotes from the command line. All three approaches below worked:

D:\TaskCentreResources\SalesforceIntegration\SalesforceSync.exe D:\TaskCentreResources\SalesforceIntegration\config-sample.xml id=16029
D:\TaskCentreResources\SalesforceIntegration\SalesforceSync.exe "D:\TaskCentreResources\SalesforceIntegration\config-sample.xml" "id=16029"
"D:\TaskCentreResources\SalesforceIntegration\SalesforceSync.exe" "D:\TaskCentreResources\SalesforceIntegration\config-sample.xml" "id=16029"

As the paths suggest, we're syncing data from iMIS to Salesforce.com. I can verify that the commands above work by changing the first name of contact #16029 in iMIS then running one of the commands above and confirming the change in Salesforce.com.

Assuming TaskCentre is constructing one of the derivatives of the call above, the Task never successfully executes because the changes don't end up in Salesforce.com as they do from a straight command-line call.

Please advise - thanks!

The second parameter may be the issue

I have a hunch that it is the second parameter that is the issue. It looks as though you need to pass the whole string "ID=16029". If you create the parameter (in the Call Program step) and call it 'ID' with a value of 16029 from a variable the program will only get 16029.

Try setting the value in the second parameter to the full string "ID=16029". Make sense?

Let me know if this works. If it does I'll show you how to create the full parameter string dynamically.

 

Paul Cannon
Fisher Technology

Full string for second parameter is "ID=16029"

Thanks Paul,

The second parameter is currently set to "ID=16029" (the full string the program would). I did try only setting it to "16029" early on but assumed that TaskCentre would only send the values on as parameters, so I reverted it to "ID=16029". Doesn't seem to work though...

Try calling cmd file instead

Another approach to try is to call the program via a command/batch file. For now just hard code the parameter values.

Tried writing a batch then calling it. Didn't work...

I modded the task to save a batch file with the correct command in it using the "Save as File" output tool , then told the "Run Program" tool to run the batch file that was just written.

The task writes the batch file fine but the "Run Program" step doesn't call it...?

If I double-click the batch file that was written, it executes without error and the data sync works.

Could there be some kind of syncing / sequencing issue with the "Run Program" tool?

Blerg...

Out of ideas

I'm sorry but now I am out of ideas.

I suggest that you raise an SMR and escalate the issue to it can be properly investigated.

Thanks for trying Paul!

Appreciate your trying to help Paul. I have submitted a case to ASI and am hoping to hear back.

By any chance, would have an example TaskCentre task that uses Run Program with params that you could export and send my way?

Also, is there a tech support process at Orbis that I could work through?

Examine those params

Try having your task execute an application which just logs the parameters it received.

As a batch file, you could do this:

@echo off
echo Program "%0" >> myLog.txt
:loop
if (%1)==() goto done
echo Param "%1" >> myLog.txt
goto loop
:done
echo End of parameters >> myLog.txt

This will tell you if it ran, and what exactly it had to work with.

If it won't run a batch file, try changing your command to "cmd /c myBatch.bat".

--
Bruce Wilson
Director, Technical Services
RSM McGladrey, Inc.

Got it!

Thanks for everyone's help! I got it working! I'll post details about it later this afternoon.

Whoops, that batch file

Whoops, that batch file should have a line that says "shift" right before "goto loop".

Strange that I can't edit...

--
Bruce Wilson
Director, Technical Services
RSM McGladrey, Inc.

No posting of what your did!

Could  you post how you resolved this issue?  All this discussion and no result.

Please? I am having a similar problem.