Kaseya Community

Forcing Kaseya script to wait until previous step is done

This question is not answered

Hey folks. I'm a bit new at Kaseya scripting so the question I have will probably be a simple/easy one for the experts here. I'm converting a batch file that I use into a Kaseya script for use at work - I'm using execShellCommand to start a number of .exe files but they are required to run in a certain order; the problem that I'm having is that the script isn't waiting for the previous operation to finish before it moves on and kicks off the next .exe file.

Is there a way to force it to wait until the other operation is finished? It's all one big script, should I break each step into a separate procedure and call to them in a master procedure?

Thanks in advance!

All Replies
  • You could do that or you could use the pause procedure between the steps.

    Interestingly you'll find a lot of scripts that you'll find here push down a batch file and run that via Kaseya.

  • You have a couple options actually. The first is use executeFile and then select the run as user/system and wait. Or, if that does not work, you could use executeshellcommand and and do start /wait nameoffile

  • Use the START /WAIT command as suggested.  In a batch file this is how you start an executable and get the script to wait for the executable to exit before moving on.  As long as Kaseya is waiting for that step to finish it should not move on to the next step.