Forum Discussion
chriscc
3 years agoContributor
Hi jmoe ,
Assuming you can see the process in task manager, you could use that name to look for the process for a specified time and if found then terminate it.
Something like this:
if (Sys.WaitProcess("YourProcessName", 2000).Exists)
Sys.Process("YourProcessName").Terminate();
Or if you have the System.Diagnostics.dll added in the Project's CLR Bridge, like this:
chriscc_0-1665517036407.png
Then you could possible utilize DotNet, like this:
var processes = dotNET.System_Diagnostics.Process.GetProcessesByName("YourProcessName");
for (var i = 0; i < processes.Length; i++)
{
var p = processes.Get(i);
p.Kill();
}
Please note: this approach will terminate All process with the provided name.
I hope this helps.
Regards,