From: dave.burt@... Date: 2005-10-19T17:11:58+09:00 Subject: Re: Killing Threads & Processes on Windows nobuyoshi nakada wrote: > Hi, > > At Wed, 19 Oct 2005 11:16:57 +0900, > dave.burt@gmail.com wrote in [ruby-talk:161280]: > > You can write the WMI script in Ruby: > > > > require 'win32ole' > > strComputer = "." > > objWMIService = WIN32OLE.connect \ > > ("winmgmts:\\#{strComputer}\root\cimv2") > > colProcessList = objWMIService.ExecQuery \ > > ("Select * from Win32_Process Where ProcessID = 3672") > > colProcessList.each do |objProcess| > > objProcess.Terminate() > > end > > Does it work on Win9X? No, I don't think so -- I think all of WMI is WinNT family only, but this is a direct translation of the VBScript given. If you're asking about my suggestion of using TerminateProcess() as an alternative to signals to close a popen'd process in IO#close, then the answer is yes. (TerminateProcess(), not ExitProcess() which kills the calling process.) Documentation for TerminateProcess(): http://msdn.microsoft.com/library/en-us/dllproc/base/terminateprocess.asp Cheers, Dave