Why not register (free) so you can use our Forums and be involved in more give-aways, promotions, competitions and updates – Register Here – already registered? Why not Log in
You need to log in to create posts and topics.

Opening x2 .exe files and closing them both from Launchbox

Hey guys, so heres what I am trying to do , maybe you can help, because I have hit a brick wall....

I want to open a game AND a running .exe in the background, when I exit the game, I want to return to Launchbox AND the other opened .exe to close too.

So at the moment, Launchbox makes it easy to launch the game.exe and another .exe however when you exit the game, the other .exe continues to run with no (or at least i think) way of closing the non-game.exe

Advice ? script? help ?

I'd be VERY grateful for the help, like I have a spare usenet account or can purchase you some membership on arcadepunks, just need the answer lol

A little more info could help. Programs?

Change the example to paths and exe's that you use should work.

Add a new emulator in LB.

Named it "Snes retroarch". or whatever

Pointed the path to retroarch.

Bulk edit all or some snes roms to use the newly added emulator.

Obviously it will still be using your normal retroarch but now your have an autohotkey tab in LB just for snes.

At this point your gonna have to download and install autohotkey.

Right click on desktop, new, autohotkey script.

Copy and paste the following underneath the other lines.

#SingleInstance, Force
#Persistent
SetTitleMatchMode 2

Run path-to-first-app
Sleep, 2000
 
SetTimer, ProcessCheckTimer, 3000
Return
 
ProcessCheckTimer:
Process, Exist, retroarch.exe
pid1 := ErrorLevel
If (!pid1)
         {
	 Run path-to-second-app
         ExitApp
         }
Return

In this script you have to change "path-to-first-app" and "path-to-second-app".

So the idea with this script is when you execute it, it will run your first app. Then every 3 seconds it checks to see if retroarch is running. If it doesn't find the retroarch process (so after you have exit) it then runs the second app and exits the script.

Save as anything.ahk

Move the script to somewhere you can store it.

Back in LB, edit your new emulator.

In the autohotkey tab put:

Run path-to-new-autohotkey-script.

yes..Just change it to suit you.

Ahhh...

So the idea with this script is when you execute it, it will run your first app. Then every 3 seconds it checks to see if retroarch is running. If it doesn't find the retroarch process (so after you have exit) it then runs the second app and exits the script.

No, this is not what I am trying to achieve.. Its almost correct...

I want to run 2 exes,   for example jukebox.exe and creditsim.exe

when jukebox.exe exits I also want creditsim.exe to exit

I can set launchbox to run both .exes easy enough, but at present it continues to run creditsim.exe even when I exist jukebox.exe , so all I need a script to do is check if jukebox.exe is running, if not then close creditsim.exe

- can you help with that?

Have you tried this?

$Esc:: { Process, Close, {{{StartupEXE}}} }

Quote from RexRyan on September 28, 2018, 2:21 pm

Have you tried this?

$Esc:: { Process, Close, {{{StartupEXE}}} }

Nope - I will look at it when I get back tomorrow evening, thanks man