Terminate Process like Task Manager

Hi all,

In Ignition, if we use something like

processpath = "C:\\mypath.exe" system.util.execute(["C:\\windows\\system32\\cmd.exe","/C","start", processpath])

we can start a process (as in above: .exe file)

My question is, how do we do the reverse? I mean, terminating the process we have started (forcefully) like Windows task Task Manager?.

Thanks!

I don’t have Windows here to test this but how about something like this?

Consider using java’s Runtime or ProcessBuilder to give you access to the Process when you create it:from java.lang import Runtime myProcess = Runtime.getRuntime().exec("my command and options") .... myProcess.destroy() .... myProcess.destroyForcibly()This also give you many options on how the application is started, including stream redirection.

Hi pturmel,

The java Runtime works well. Thanks! =)