samedi 20 juillet 2019

timeout using if - batch File

I have a .bat file which runs 3 instances of VBScript, they each take approx 3 mins to run. They run in a chain sequence one after the other, one by one.

Sometimes the program which is run from the script is terminated[by user] but the script still keeps running if seen in the Task Manager, so as it keeps running the next instance of the script does not start.

I wanted to know is there a way to kill the script within a set time if its not completed, like say after 5 mins if it is still running, force kill it and move to the next instance and dont want to wait extra time if the script is finished in 3 min only then the next should start immediately after that and not wait for 5 mins

I tried using timeout but it keeps waiting for 5 mins even if the script ends early

Here is the batch file

"C:\Users\Aditya\Documents\Loot1.vbs"
"C:\Users\Aditya\Documents\Loot2.vbs"
"C:\Users\Aditya\Documents\Loot3.vbs"

Aucun commentaire:

Enregistrer un commentaire