Kill a process only if it’s running,

Hello,

I want to check chrome or excel if it’s running.
Kill process.

Please guide me for solve it.
Thank you

Hi @Stef_99

Can you try like below

currentProcess.ProcessName.ToLower().Contains("chrome") Or currentProcess.ProcessName.ToLower().Contains("excel")

or You can directly give like below if the process is opened then it will close

image

Check this

Regards,

1 Like