From: x1 Date: 2005-10-19T10:30:52+09:00 Subject: Re: Killing Threads & Processes on Windows Thank you for the response. I did find a hack using wscript that id like to share: x = IO.popen("c:/program files/internet explorer/iexplore.exe") x.pid => 3672 system("wscript.exe test.vbs") I know this is a hack but can win32api not be used to make a ruby implementation of this? ------------------------test.vbs-------------------- strComputer = "." Set objWMIService = GetObject _ ("winmgmts:\\" & strComputer & "\root\cimv2") Set colProcessList = objWMIService.ExecQuery _ ("Select * from Win32_Process Where ProcessID = 3672") For Each objProcess in colProcessList objProcess.Terminate() Next -----------------------/test.vbs---------------------------- Thx again!! On 10/18/05, nobu.nokada@softhome.net wrote: > Hi, > > At Wed, 19 Oct 2005 07:44:35 +0900, > x1 wrote in [ruby-talk:161230]: > > x = Thread.new { system("c:/program files/internet explorer/iexplore.exe") } > > x.alive # Works > > > > why doesnt x.kill actually "kill" internet explorer? When I think of > > kill, I think of "gone" as in *nix gone. > > A thread and a process spawned within it are not related. > > > x = IO.popen("c:/program files/internet explorer/iexplore.exe") > > x.close > > IO#close try to send a signal to the process, however, the > problem is no signal mechanism across processes on Windows, > unless the target has a console. > > -- > Nobu Nakada > >