Forum: Ruby on Rails under windows: launching an external app via system... but not waiting for a response

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
A07f0662e96a632d9447a710adadbe05?d=identicon&s=25 Phil Smy (phileuro)
on 2009-02-01 10:25
(Received via mailing list)
Hi,
I have an application written in Ruby (it's actually a windows
service). It needs to launch other applications. The problem I am
having is that when I call system("args to launch app") it never
returns, because I guess the app never returns until it is closed.

I want to be able to launch the app and then continue on.
What is the proper way to do this? A thread?
1f2eadfb41362800ebc2cf211b91d0f7?d=identicon&s=25 javier ramirez (Guest)
on 2009-02-01 12:05
(Received via mailing list)
> service). It needs to launch other applications. The problem I am
> having is that when I call system("args to launch app") it never
> returns, because I guess the app never returns until it is closed.
>

you can use the "start" windows command, so from your system call you
would call "start" passing the parameters to start your external
application. If you don't want to see a shell window, you can pass /B to
the start command

regards,

--
javier ramírez

..i do ruby on rails development in madrid, spain, at
http://www.aspgems.com
..you can find out more about me on http://formatinternet.wordpress.com
and http://workingwithrails.com/person/5987-javier-ramirez
34a7615f38496a5dafbb3e6b721c435e?d=identicon&s=25 Mohit Sindhwani (Guest)
on 2009-02-01 16:08
(Received via mailing list)
phil wrote:
> Hi,
> I have an application written in Ruby (it's actually a windows
> service). It needs to launch other applications. The problem I am
> having is that when I call system("args to launch app") it never
> returns, because I guess the app never returns until it is closed.
>
Do a
system ("start application.exe args to launch app")
This topic is locked and can not be replied to.