# Under windows: launching an external app via system... but not waiting for a response

**URL:** <https://www.ruby-forum.com/t/under-windows-launching-an-external-app-via-system-but-not-waiting-for-a-response/159143>\
**Category:** Rails\
**Created:** [February 1, 2009, 10:25am UTC](https://www.ruby-forum.com/t/under-windows-launching-an-external-app-via-system-but-not-waiting-for-a-response/159143 "2009-02-01T10:25:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![philswenson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/7feea3/32.png) [@philswenson](https://www.ruby-forum.com/u/philswenson)\
**Post date:** [February 1, 2009, 10:25am UTC](https://www.ruby-forum.com/t/under-windows-launching-an-external-app-via-system-but-not-waiting-for-a-response/159143/1 "2009-02-01T10:25:11Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![philswenson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/7feea3/32.png) [@philswenson](https://www.ruby-forum.com/u/philswenson)\
**Post date:** [February 1, 2009, 12:05pm UTC](https://www.ruby-forum.com/t/under-windows-launching-an-external-app-via-system-but-not-waiting-for-a-response/159143/2 "2009-02-01T12:05:22Z")

</div>

> 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](http://www.aspgems.com)  
…you can find out more about me on [http://formatinternet.wordpress.com](http://formatinternet.wordpress.com)  
and [http://workingwithrails.com/person/5987-javier-ramirez](http://workingwithrails.com/person/5987-javier-ramirez)

---

<div class="post-metadata">

**Author:** ![philswenson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/7feea3/32.png) [@philswenson](https://www.ruby-forum.com/u/philswenson)\
**Post date:** [February 1, 2009, 4:08pm UTC](https://www.ruby-forum.com/t/under-windows-launching-an-external-app-via-system-but-not-waiting-for-a-response/159143/3 "2009-02-01T16:08:44Z")

</div>

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”)
