From: John Allen Date: 2011-01-24T02:54:02+09:00 Subject: Re: detection process in windows xp, vista, seven. Are you looking for something like this??: require 'win32ole' wmi = WIN32OLE.connect("winmgmts:{impersonationLevel=impersonate}!//./root/cimv2") cmdln = false if ARGV[0] ps = wmi.ExecQuery("Select * from Win32_Process Where ProcessId = #{ARGV[0]}") cmdln = true else ps = wmi.ExecQuery("Select * from Win32_Process") end puts " Process Name PID PRI Thd Virtual Size" puts "================================ ====== === === ====================" ps.each do |p| puts p.Name.ljust(35) + p.ProcessId.to_s.ljust(8) + p.Priority.to_s.ljust(5) + p.ThreadCount.to_s.ljust(5) + p.VirtualSize.to_s if cmdln puts p.CommandLine.to_s end #puts " CMD: " << p.CommandLine.to_s #puts " PID: " << p.ProcessId.to_s #puts " Priority: " << p.Priority.to_s #puts " Threads: " << p.ThreadCount.to_s #puts " Size: " << p.VirtualSize.to_s end -- Posted via http://www.ruby-forum.com/.