Run the program and return immediately

  • Thread starter Victor 'Zverok' Shepelev
  • Start date
V

Victor 'Zverok' Shepelev

Hi all.

The question first seemed simple for me, but after hour of manual-reading
and googling I still have no answer.

The question: on Windows, how do I run some program and return immediately?
I mean, something like

system('blah.exe') #blah is long packet program, I want system to return
immediately after blah.exe loaded, not after it was ended.

Thanks.

Zve
 
S

Siep Korteling

Victor said:
Hi all.

The question first seemed simple for me, but after hour of
manual-reading
and googling I still have no answer.

The question: on Windows, how do I run some program and return
immediately?
I mean, something like

system('blah.exe') #blah is long packet program, I want system to return
immediately after blah.exe loaded, not after it was ended.

Thanks.

Zve

`start blah.exe`

Note the ` , it's not a '.

Regards,

Siep
 
J

Justin Collins

Victor said:
Hi all.

The question first seemed simple for me, but after hour of manual-reading
and googling I still have no answer.

The question: on Windows, how do I run some program and return immediately?
I mean, something like

system('blah.exe') #blah is long packet program, I want system to return
immediately after blah.exe loaded, not after it was ended.

Thanks.

Zve

One way:

t = Thread.new do
system("blah.exe")
end

#do other stuff

t.join

Traditional fork and exec way:

child_pid = fork
exec("blah.exe") unless child_pid

#do stuff

Process.wait # or Process.detach


I believe this should work fine on Windows.

-Justin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top