Jump to content
LaunchBox Community Forums

Launchbox ability to startup script/app on launch and kill on close


ckp

Recommended Posts

I submitted an enhancement ticket for this. Please vote for it if you want it:

https://bitbucket.org/jasondavidcarr/launchbox/issues/2028/launchbox-ability-to-startup-script-app-on

There are several things I need to do outside of LB/BB since LB doesn't have the ability to do some of the things I need and I have to handle it using a stand alone autohotkey script or some other program or script. I'd rather not launch my other scripts/programs at Windows startup or manually because I only want them to run when LB/BB runs. It would be nice if LB could startup your external scripts/programs and kill then on LB close as well. I have seen other front ends that have this ability.

 

Edited by ckp
Link to comment
Share on other sites

You could create an autohotkey script that is always running and looks for launchbox or bigbox running and then starts. Example below checks for Launchbox or Bigbox every 6 seconds, if either is running it opens notepad, if neither is running it closes notepad.

 

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

#persistent
Loop
{
Running = 0
Process, Exist, Launchbox.exe ; check to see if Launchbox is running
If (ErrorLevel <> 0) ; If it is running
    {
    Running = Running + 1
    }
    
Process, Exist, Bigbox.exe ; check to see if Bigbox is running
If (ErrorLevel <> 0) ; If it is running
    {
    Running = Running + 1
    }
    
If Running = 0 ; If it is not running
    {
    Process, Close, notepad.exe ; Close notepad
    }
Else ; If it is running, ErrorLevel equals the process id for the Launchbox
    {
    Process, Exist, notepad.exe ; check to see if Printkey.exe is running
        If (ErrorLevel = 0) ; If it is not running
            {
            Run, notepad.exe
            }
    }
Sleep 6000    ; sleep .1 minutes
}

Link to comment
Share on other sites

Yeah I have something very similar already, which also runs some other things too like a "loading'" splash screen for LB game unzipping, but my preference is to just run these things from LB and not at any other time. But your suggestion is a good alternative.

Link to comment
Share on other sites

You could just create a .bat or .cmd file that runs the programs you need, then waits for LaunchBox to end, then kills everything else, and exits..  A little command line utility called "pskill" can assist with forcing things to close without doing it manually.

 

Link to comment
Share on other sites

  • 3 years later...

I would like to be able to launch a selected game in BigBox automatically on startup since my Mame cabinet is a replica Starfighter cabinet.  I want to run Bigbox but have it auto-run Starfighter when Bigbox loads up.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...