Direct call vs call vs start

I am having this problem when running a batch file with Tivoli Workload Scheduler.

There is a third-party program, let it say that its name is program.exe

The batch file contains the following command to invoke program.exe

program.exe param1 param2 param3

      

The problem is that the batch file terminates when the warning pop-ups appear from the program.exe file; but we're okay with the warning popup. We want it to run no matter how many warnings it encounters.

I researched this and found out that using "start" can fix the problem.

'call' behaves the same as a direct call.

So when we call the program directly, does it have a default value?

call program.exe

      

or is there a significant difference between direct invocation and invocation?

+3


source to share


2 answers


This is not a difference for the program, but you get different results for the parameters, since the parameters will be evaluated by the parser twice.

program Program^&Documents "One caret ^ "
call program.exe Program^&Documents "One caret ^ "

      

The first line works as expected, but the second result in



program.exe Program
&Documents "One caret ^^ "

      

And it ends completely because it &

cannot be evaluated in CALL

.
And the calls are doubled on call.

+3


source


Is there a significant difference between direct invocation and invocation?

No difference: you could call

call another cmd script command.
It also ensures that you return to the current script after the call completes.



You can also use it to call a function in your current script.

+2


source







All Articles