Kill all the process

Hi All

Can anyone please share the steps to kill all the process?

Thanks
Krishnakumar

Hi @Krishnakumar149

You can use Kill Process activity

image

You just have to pass the name of the process what you wan to kill, let’s say if you want to close all the chrome browsers that are open use this

image

Thanks,
Prankur

1 Like

@Krishnakumar149 Try this.

Use Get Processes Activity which have a outcome of array of processes . Then Iterate Through the variable out from the activity and used use kill process with in the for each loop and pass the input in the kill process activity process text box to kill all the open processes.

Cheers

1 Like

Hi @Krishnakumar149

To kill a process you need to make the two following steps:

  1. find the name of the process responsible for the application in the task manager (sometimes the app and the process have the same name like “Chrome.exe ==> Chrome” other times it’s different for e.g “iexplore.exe ==> internet explorer” )

image

  1. use kill Process activity with and write the Name found in Process Name property.

finally see below example xaml file for terminating internet explorer.
Main.xaml (4.2 KB)

Hope it helps,
Regards,
Reda

5 Likes

Hi Reda

Thanks for your quick help. In-case, we have many process are running at the same time. Do we have to drag multiple kill process at the time? Kindly advise.

Thanks
Krishnakumar

Thanks for your e-mail. Grateful if you could provide any sample xaml for this.

Thanks
Krishnakumar

Hi @Krishnakumar149

See this

Main.xaml (7.7 KB)

Thanks,
Prankur

3 Likes

Thanks Prankur.

I was getting the below error When i opened this code.

Kindly help.

Thanks
Krishnakumar

This might be because of the version you are using of Studio, update your packages it is For Each loop only, see screenshots -

image

image

Thanks,
Prankur

Hi Prankur

Thanks for your kind help.

Thanks
Krishnakumar

1 Like

Hi Prankur

I opened one excel file before i ran this xaml nothing has happened. If possible kindly check and share your thoughts on this.


Thanks
Krishnakumar

Please use

item.ProcessName 

Also, use EXCEL in uppercase and in For each loop argument type must be

System.Diagnostics.Process

Thanks,
Prankur

Hi Prankur

Thanks for your correction. I made the changes and still getting the same.

Can you show me Argument Type property of For each loop?

Also, you have to pass item.ProcessName in ProcessName property of kill process activity

Thanks,
Prankur

Hi Prankur

Thanks for you kind help. Please find below argument type of For each loop

Still getting the same. Please advise.

Thanks
Krishnakumar

See above post, I mentioned to change Argument Type property of For Each to

System.Diagnostics.Process

Thanks,
Prankur

Hi Prankur

PFA my xaml file. If possible kindly check and correct where needs to be changed. Thanks for your help.

multiple process.xaml (7.1 KB)

@Krishnakumar149 Instead of using item.tosting use item.ProcessName in If statement and
in Kill Process activity property , You are passing “Excel” instead of this pass item.ProcessName

1 Like

Hello @Krishnakumar149

Please check attached xaml file and replace with your. Made changed: Changed Item type in for Each loop and if condition.

It is working for me now.multiple process.xaml (7.2 KB)

Hello,

Try using a kill process activity and configure a process name.
That should help you