Run another .exe and end current

BlitzMax Forums/BlitzMax Beginners Area/Run another .exe and end current

duquette(Posted 2008) [#1]
How can I execute another .exe file from current application, then end the current application.

I've tried this:

proc = TProcess.Create("warning2.exe", 0)
end

But the "end" command seems to close the warning2.exe as well as the current application, I only want to end the current application and have warning2.exe run.


Arowx(Posted 2008) [#2]
I think that the child process that was launched is attached to the parent!

You can probably wait for the child process to complete before ending the parent process?


GfK(Posted 2008) [#3]
Try OpenURL().


dmaz(Posted 2008) [#4]
what about system_() (I didn't test it though)


SebHoll(Posted 2008) [#5]
what about system_() (I didn't test it though)

Unlike OpenURL(), system_() is blocking (the caling program will hang until the new process has terminated) and so isn't really inline with duquette's requirements.


Grey Alien(Posted 2008) [#6]
I ran across this issue a long time ago. In the end I made a helper app that I spawn which loads the second app so that I can shut the first one down. There's probably a more sensible way to do it.