# Terminate Process like Task Manager

**URL:** <https://forum.inductiveautomation.com/t/terminate-process-like-task-manager/10666>\
**Category:** Ignition\
**Created:** [October 26, 2015, 10:11am UTC](https://forum.inductiveautomation.com/t/terminate-process-like-task-manager/10666 "2015-10-26T10:11:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ian](https://avatars.discourse-cdn.com/v4/letter/i/bb73d2/32.png) [@ian](https://forum.inductiveautomation.com/u/ian)\
**Post date:** [October 26, 2015, 10:11am UTC](https://forum.inductiveautomation.com/t/terminate-process-like-task-manager/10666/1 "2015-10-26T10:11:50Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![AlThePal](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/althepal/32/3603_2.png) [@AlThePal](https://forum.inductiveautomation.com/u/AlThePal)\
**Post date:** [October 26, 2015, 7:05pm UTC](https://forum.inductiveautomation.com/t/terminate-process-like-task-manager/10666/2 "2015-10-26T19:05:36Z")

</div>

I don’t have Windows here to test this but how about something like [this](https://docs.python.org/2/faq/windows.html#how-do-i-emulate-os-kill-in-windows)?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [October 26, 2015, 9:00pm UTC](https://forum.inductiveautomation.com/t/terminate-process-like-task-manager/10666/3 "2015-10-26T21:00:41Z")

</div>

Consider using java’s [Runtime](http://docs.oracle.com/javase/8/docs/api/java/lang/Runtime.html) or [ProcessBuilder](http://docs.oracle.com/javase/8/docs/api/java/lang/ProcessBuilder.html) to give you access to the [Process](http://docs.oracle.com/javase/8/docs/api/java/lang/Process.html) 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.

---

<div class="post-metadata">

**Author:** ![ian](https://avatars.discourse-cdn.com/v4/letter/i/bb73d2/32.png) [@ian](https://forum.inductiveautomation.com/u/ian)\
**Post date:** [November 3, 2015, 4:31am UTC](https://forum.inductiveautomation.com/t/terminate-process-like-task-manager/10666/4 "2015-11-03T04:31:00Z")

</div>

Hi pturmel,

The java Runtime works well. Thanks! =)
