cancel
Showing results for 
Search instead for 
Did you mean: 

How to kill all chrome instances

EstebanMontesi1
Level 3
Is there any way to kill all instances of chrome open?

------------------------------
Esteban Montesinos
------------------------------
13 REPLIES 13

james.man
Staff
Staff
You will probably need to use either code stages or batch files (tasklist + taskkill command?) to do this.

------------------------------
James Man
Professional Services
Blue Prism
Asia/Hong_Kong
------------------------------

What code will be needed on the code stage?

------------------------------
Esteban Montesinos
------------------------------

VivekGoel
Level 10
Simple use "Utility -Environment" --> Kill process with "chrome" as input.

24354.png


------------------------------
Vivek Goel
Register for "The" RPACULT 2020- The Unique RPA Hackathon of 2020.
https://rpatools.com/the-rpacult/
------------------------------

Hi,

You can achieve this using below method.

1.using navigate stage - select root element in navigate stage and select terminate from drop down action.
2.using action stage - select utility Environment vbo and select action kill process ( Parameter will be "Chrome")

I hope it will help.



------------------------------
Nilesh Jadhav
Senior RPA Specialist
------------------------------
Nilesh Jadhav.
Consultant
ADP,India

Hi Vivek,

It's not working for me. Can you please suggest, where I might be wrong. Thank you.

------------------------------
Simanchala Pattanayak
Lead Solution Advisor
Deloitte USI
Bangalore
------------------------------

Can you please share a screenshot of your "kill process" properties?

------------------------------
Michael Annis
------------------------------

Hello Annis,

Sorry, can't share the screenshots due to security concern. Let me brief the issue bit more.
We can able to close the Chrome instance in our PROD environment, but in DEV the Kill Process is not working. It's not throwing any error, it's just crossing the stage without closing the Chrome.

FYI:
BP Version: 6.10.4
Chrome 107
Chrome Extension: 6.10.4

Kindly advise.

------------------------------
Simanchala Pattanayak
Lead Solution Advisor
Deloitte USI
Bangalore
------------------------------

You could try via command line:

taskkill /IM chrome.exe /F

Good luck!

------------------------------
Michael Annis
------------------------------

Hello @SimanchalaPatta

Utility -Environment" --> Kill process  uses Process.Kill.
This is description of Process.Kill Method : Process.Kill Method (System.Diagnostics) | Microsoft Learn
It says:
WaitForExit and HasExited will indicate that exiting has completed after the given process exits, even if all descendants have not yet exited.

So I made Code Stage. "ProcessName" is a input argument.

Dim p As New System.Diagnostics.Process()

p.StartInfo.FileName = System.Environment.GetEnvironmentVariable("ComSpec")
p.StartInfo.Arguments = "/c taskkill /F /T /FI ""username eq %USERNAME%"" /IM " & ProcessName
p.StartInfo.UseShellExecute = false
p.StartInfo.CreateNoWindow = true

p.Start()

p.WaitForExit()
p.Close()



------------------------------
Mitsuko
Asia/Tokyo
------------------------------
------------------------------
Mitsuko
Asia/Tokyo
------------------------------