Kill processes


#1

Hi,

I want to loop through all the running processes (get processes activity), after I got a lost of all runningen processes I want to close those wich name containes “iexplore” but when an openend window from iexplore with multiple tabs it gives an error. apparently all the opened tabs are in the list of running processes and when I’m looping through that list and kill the process wich name contains “iexplore” than I kill all those processes from those multiple tabs all in once which causes in an error, because they are still in the list.
How do I solve this issue?


#2

Hi @Siene,

Looks like you would want to get the list again and then loop through checking for any remaining iexplore processes.

You can then exit as normal once you no longer have any iexplorers to kill.


#3

I believe you are doing something like this,

  1. Get list of all the Processes using ‘Get Process’ activity
  2. Use a for each loop to iterate through all of them.
  3. Add an If condition to check if the process name matches “iexplore”
  4. Add a ‘Kill Process’ inside if condition to kill the process if match is found.

Let me know if that’s not what you are doing.

Is it mandatory for you to get all the processes and then check for iexplore.? Did you try directly using ‘Kill Process’ activity with process name as ‘iexplore’. I believe it should not through any error even if there is no ‘iexplore’ process running. I may be wrong.

You can also try adding a ‘Break’ activity after your kill process to come out of the loop as soon as it is done. Let me know if it works.

Thanks,
Rammohan B.


#4

Thank you for your answer!
indeed the kill process activity just did the job, I thought this was just for one process but indeed it kills all the webpages of iexplorer also the one with multiple opened tabs,
Thank you!


#5

Great @Siene. Happy to help. :slight_smile:

Thanks,
Rammohan B.