Command stop all tasks

Discuss RoboTask here
Post Reply
Rukbunker
Posts: 194
Joined: Mon Feb 22, 2016 4:06 pm
Location: Netherlands

Command stop all tasks

Post by Rukbunker »

Hey there!

Is there a command to stop (or better: KILL) all tasks which are currently running at that moment? I can only define "This task", or another one, but not all running.
Oleg
Site Admin
Posts: 3010
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: Command stop all tasks

Post by Oleg »

...or better: KILL...
This is a very bad idea

You can use the small script in VB Script action

Code: Select all

cnt = RoboTaskApp.TaskCount
for i=0 to cnt-1 step 1
  nam = RoboTaskApp.TaskInfoExtname(i)
  logmessage("Stop task " + nam)
  RoboTaskApp.StopTask(nam)
next
This script will stop all your tasks
Oleg Yershov
Oleg
Site Admin
Posts: 3010
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: Command stop all tasks

Post by Oleg »

It's better to turn automation off too. Because some tasks can be started automatically by its trigger
Oleg Yershov
Rukbunker
Posts: 194
Joined: Mon Feb 22, 2016 4:06 pm
Location: Netherlands

Re: Command stop all tasks

Post by Rukbunker »

I know it's dangerous. But in our case, it really saves some trouble! Thanks, it works.
Oleg
Site Admin
Posts: 3010
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: Command stop all tasks

Post by Oleg »

Now you can kill the task manually only
Oleg Yershov
Rukbunker
Posts: 194
Joined: Mon Feb 22, 2016 4:06 pm
Location: Netherlands

Re: Command stop all tasks

Post by Rukbunker »

Well, I have simulated the problem when Robotask should kick in and kill all the 3 tasks which are running at that moment. When the problem occured, Robotask killed all the 3 tasks immediately. As it should be. I am satisfied! :D
Post Reply