From: Sard Aukary Date: 2006-08-11T04:40:19+09:00 Subject: Re: Start an external application - How? Joe Percival wrote: > David Jones wrote: >> You could try using 'system', eg: >> >> system("yourwebcamapp.exe") > > system seems to want the external process to complete before continuing. > exec seems to wait for completion of the external process as well. I > need to start an external process and then go on to the next command > without waiting for the external process to complete. It would also be > nice if I could capture a handle for the external process so that I > could check status or kill it later. This code works for me. If you start the process in a seperate thread the rest of the Ruby script will continue to execute. To terminate it you need some help from the operating system by using the win32ole library http://www.ruby-doc.org/stdlib/libdoc/win32ole/rdoc/index.html require 'win32ole' program = "notepad.exe" Thread.new {system(program)} puts "Waiting 5 seconds before terminating " + program sleep 5 class WIN32OLE def to_a a = []; self.each{ |p| a<