[Howto] Running multiple Sikuli scripts using a batch file

Asked by James Garcellano

******** from comment #1
I use "call" in my batch files... see here http://ss64.com/nt/call.html

@CALL c:\SikuliX\runIDE.cmd -r c:\SikuliX\testprogram1.sikuli
@CALL c:\SikuliX\runIDE.cmd -r c:\SikuliX\testprogram2.sikuli

--------------------------------------------------------------------------------------
Hello all,

I have a similar issue with wanting to run multiple Sikuli scripts from a batch file.

I have found this question https://answers.launchpad.net/sikuli/+question/237151 which I tried to implement, however, it does not seem to be successful.

Here is my batch file:

@echo off
echo Installing software ...
echo.
echo.
start /i /b /wait c:\SikuliX\runScript.cmd -r c:\SikuliX\testprogram1.sikuli
start /i /b /wait c:\SikuliX\runScript.cmd -r c:\SikuliX\testprogram2.sikuli
echo.
echo.
pause
echo Done.

The issue that I am experiencing is that testprogram1.sikuli would run, but when finished, the command prompt window would still be open sitting at the command prompt waiting of input.
If I type 'exit' at the command prompt, the batch script would continue and rung testprogram2.sikuli.

Any suggestions would be greatly appreciated.

Thanks!

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
RaiMan
Solved:
Last query:
Last reply:
Revision history for this message
Boomy Grunt (noneathome) said :
#1

Hi,

I use "call" in my batch files... see here http://ss64.com/nt/call.html
like this:

@CALL c:\SikuliX\runIDE.cmd -r c:\SikuliX\testprogram1.sikuli
@CALL c:\SikuliX\runIDE.cmd -r c:\SikuliX\testprogram2.sikuli

Revision history for this message
Best RaiMan (raimund-hocke) said :
#2

what happens, if you use only
start /i /wait c:\SikuliX\runScript.cmd -r c:\SikuliX\testprogram1.sikuli

... and it might be worth to try this:
start /i cmd /K c:\SikuliX\runScript.cmd -r c:\SikuliX\testprogram1.sikuli

Revision history for this message
James Garcellano (jg75996) said :
#3

Hello RaiMan,

If only the first script is used, the script would execute and once finished there would be a command prompt window with the command prompt waiting for input.

I tried using the "start /i cmd /K ..." command on both scripts and when the batch file was executed, both scripts started at the same time.

Just out of curiosity, I changed from using "start ..." to "call ..." and that seemed to run each sikuli script in the way that I was looking to do.

I think I am all set. Thank you.

Revision history for this message
RaiMan (raimund-hocke) said :
#4

Thanks for feedback.

You might have already seen:
I now recommend to use "call" ;-)