From: Gordon Thiesfeld Date: 2007-12-21T00:32:21+09:00 Subject: Re: starting multiple processes On Dec 20, 2007 2:34 AM, Robert Klemme wrote: > 2007/12/20, Joel VanderWerf : > > Junkone wrote: > > > hello > > > i have to do the following > > > 1. exec("E:\\TradingTools\\IBController\ > > > \IBControllerStart_customised.bat") > > > 2. application = WIN32OLE.new("Broker.Application") > > > > > > I want to start 1 and then continue doing 2. however when i run it > > > realtime, the statement 2 waits for statement 1 to be completed which > > > takes long time. how do i initiate 1 and then withotu waiting goto > > > statement 2. > > > > Wrap #1 in a thread: > > > > Thread.new do > > exec(...) > > end > > Wouldn't help. This is #exec and not #system - the process does not > wait, it is completely replaced and "application = > WIN32OLE.new("Broker.Application")" is never executed. > > You rather want fork. > > fork do > exec ... > end > > Cheers > > robert > > -- > use.inject do |as, often| as.you_can - without end > Fork isn't implemented on Windows. Try this: system("start E:\\TradingTools\\IBController\\IBControllerStart_customised.bat") application = WIN32OLE.new("Broker.Application") -Gordon