capl

Is there a way to close terminal after calling sysExecCmd() in CAPL script?


I wrote a CAPL script that calls a python script using sysExecCmd like sysExecCmd("python",myParameters,myTree), where myTree is the current (nested) working tree wrt the current directory the CAPL resides in and myParameters are generated at runtime and take care of certain variables.

Problem is: every time sysExecCmd is called, it opens a new terminal and each one is persistent. I've tried to call a exit command without parameters in the same myTree like sysExecCmd("exit","",myTree), but it didn't work (and I didn't had many hopes it should have).

While the solution to the problem is not the central point here (I could do with a workaround and either use a batch or delegate to python to close the terminal somehow), I would like to know if there is a way to close terminals on the fly using CAPL scripts.


Solution

  • Usually, for me it works in this way:

    sysExecCmd("C:\\Projects\\CANoe\\some_script_to_execute && exit","");