# Killing a windows process

**URL:** <https://www.ruby-forum.com/t/killing-a-windows-process/73922>\
**Category:** Ruby\
**Created:** [October 28, 2006, 1:08am UTC](https://www.ruby-forum.com/t/killing-a-windows-process/73922 "2006-10-28T01:08:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![joe-dumoulin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9dc877/32.png) [@joe-dumoulin](https://www.ruby-forum.com/u/joe-dumoulin)\
**Post date:** [October 28, 2006, 1:08am UTC](https://www.ruby-forum.com/t/killing-a-windows-process/73922/1 "2006-10-28T01:08:44Z")

</div>

Hi,

I’m starting a bunch of processes using win32/process  
([http://rubyforge.org/projects/win32utils/](http://rubyforge.org/projects/win32utils/)). I want to be able to  
kill some of those processes. In \*nix, I’d send them a TERM signal.  
What’s the Windows equivalent?

Thanks,  
Joe

---

<div class="post-metadata">

**Author:** ![joe-dumoulin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9dc877/32.png) [@joe-dumoulin](https://www.ruby-forum.com/u/joe-dumoulin)\
**Post date:** [October 28, 2006, 1:26am UTC](https://www.ruby-forum.com/t/killing-a-windows-process/73922/2 "2006-10-28T01:26:46Z")

</div>

signal = 4 # or 9 if you really want to take it out 🙂  
Process.kill signal, pid

pth

---

<div class="post-metadata">

**Author:** ![joe-dumoulin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9dc877/32.png) [@joe-dumoulin](https://www.ruby-forum.com/u/joe-dumoulin)\
**Post date:** [November 10, 2006, 6:49am UTC](https://www.ruby-forum.com/t/killing-a-windows-process/73922/3 "2006-11-10T06:49:21Z")

</div>

I’m using win32/process’s Create function to start a new Windows  
process.

However, if I do a Process.kill(0, ) to a program that I started  
via Ruby, it always returns back an array with the pid in it, even if  
the process was killed.

Any ideas?

Thanks,  
Joe
