From: Daniel Berger Date: 2007-02-17T03:05:06+09:00 Subject: Re: pgrep equivalent on windows On Feb 16, 10:32 am, "akbarhome" wrote: > Hi, I have this code need to be translated to windows machine: > > `kill #{`pgrep -f optimize_jobs.rb`.chomp}` > exec("ruby -C#{RAILS_ROOT}/public/files optimize_jobs.rb &") if fork > == nil > > The second line has been translated successfully as: > require "win32/process" > exec("ruby -C#{RAILS_ROOT}/public/files optimize_jobs.rb &") if > Process.fork == nil > > But what about first line? Anybody know how to translate that to > windows machine (Windows XP Home if that matters)? > > Thank you. If you're looking for a pure Ruby solution you can use sys-proctable, and roll your own version of pgrep. Otherwise, you'll need to install some third party tool. Regards, Dan