Forum Discussion
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:
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,
- jmoe3 years agoContributor
Thanks Chris, good idea. I tried the first suggestion but same result, as in TC does not recognize the process, nothing returned. For the second suggestion, I loaded from the GAC, but what is available to the dotNET object is the same, with or without the Process addition to the CLR Bridge. In other words, the dotNET.System_Diagnostics.Process
is not available (dotNET.System_Diagnostics does have some available, but not .Process). Seems like TC is not recognizing the CLR change even though I tried install/uninstall/reload numerous times. Dunno.
Related Content
- 11 years ago
Recent Discussions
- 12 hours ago