Jump to content
LaunchBox Community Forums

execute batch file after closing bigbox?

Retro Arcader

Recommended Posts

Hey Guys,

Just a quick question.  Is it possible to run a windows batch file after exiting bigbox? 

The reason is that my PC is running 2 monitors.  one of which is inside my arcade cab.  I have a batch file that currently does the following...

  1. Switches audio output to Arcade Cabinet
  2. Switches HDMI out to Monitor in Arcade Cabinet
  3. Launches OBS minimized.  I know bigbox can do this but I like to launch OBS before starting Bigbox.
  4. Launch BigBox

    ideally I want the script to then...
  5. Wait for BigBox to exit
  6. change audio back to main display monitor
  7. change HDMI back to extended desktop display.


The very untidy version of the script is below... so basically I either need this script to wait for bigbox to exit OR at least run another script as it closes that performs 6 and 7.


Any help greatly appreciated.


@echo off

echo changing outputs
rem nircmd setdefaultsounddevice "3 - 2369M" 1
rem C:\Windows\System32\DisplaySwitch.exe /internal

echo starting OBS
cd "C:\Program Files\obs-studio\bin\64bit\"

start /min obs64.exe

cd "D:\My Games\Launchbox"

start /WAIT bigbox.exe

echo restoring system
nircmd setdefaultsounddevice "4 - LG TV" 1
C:\Windows\System32\DisplaySwitch.exe /extend




Link to comment
Share on other sites

I think the method you're using is spot on.  However I may be biased as that's exactly how it do it.  :D

I have my cab connected to my TV (actually to the AVR, then TV) via HDMI.  [The cab monitor connects uses the DVI port on the video card]  

I used a program called MonitorSwitcher (found on SourceForge [it's free]) to create my [custom] different monitor configurations, and then load those from a batch file.  The configs used here are "cab-only" (single monitor, only using the cab's monitor) and "TV-Primary" (dual monitor, with the TV as the primary monitor).

@echo off
cd "F:\Monitor Switcher"
start /w "" "MonitorSwitcher.exe" -load:TV-Primary.xml

cd "F:\LaunchBox\core"
start /w "" BigBox.exe

cd "F:\Monitor Switcher"
start "" "MonitorSwitcher.exe" -load:cab-only.xml

You'll note here, I start BigBox from the ../Core/ directory.  Reason being... running  F:\LaunchBox\BigBox.exe  will actually  start - exit - then start F:\LaunchBox\Core\BigBox.exe  .   So you can imagine what that does to the "start /w" in the batch file. ;) 

Also note the double double-quotes after "start /w".  Off hand I forget the what's-and-why-for's they're there.  But (without looking it up) I'm sure it's for a good reason.

And because it uses the HDMI to the TV (primary), the audio it automatically redirected.

Love the use of "DisplaySwitch".  I was not aware of that 'command line' option.  Thank you.  The problem I have with that is the HDMI port on my video card takes to spot of Monitor 1.  So not sure how that would work.

  • Thanks 1
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.

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...