Build Your Own Arcade Controls Forum
Main => Main Forum => Topic started by: Turnarcades on October 28, 2011, 03:21:59 pm
-
Hi. Just a quickie I hope someone can help me with.
I'm setting up a system running two games only (both PC games with .exe extensions). Rather than having a front-end I want to set it up so it automatically boots into the first game, but when this program exits it automatically starts the second game and vice versa, so quitting one game always launches the other one.
I'm thinking a batch file will do the trick, setting the Windows shell to launch the .bat file on startup (as I've done with other projects), but I just need to know what to put in it to do this?
-
@echo off
:rungame1
GAME1.EXE
:rungame2
GAME2.EXE
goto rungame1
-
There are many sites with good details on Windows batch scripting. If you haven't find some, do a Google search.
You can use this as a basic framework. I put in pauses instead of running programs and echo statements so you can see that it works. Save the following into a .bat plain text file (e.g. use Notepad):
:first
echo first
pause
goto second
:second
echo second
pause
goto first
-
Thanks for the replies. So JODY, I just need to substitute the 'pause' entries with the exe file locations? I've created and used batch files before, it's just the actual logic of the entries that baffle me a bit.
Codefenix, yours is different, would this always switch back and forth between the games or just end after relaunching game 1?
-
The first example runs the first game then upon exit would run the second. After exiting the second, it loops back to the top and runs the first one again.
Mine had some unneeded lines. The goto second isn't needed as it would fall into that part anyway. Just wanted to show you some syntax. Basically you can create sections and use goto statements to jump around.
-
Ok thanks, I'll give them a try! Reminds me of my days messing with Speccy basic.
-
@echo off
:Games
game1.exe
game2.exe
goto games
-
!!!! When I was a kid, I was obsessed with programming. Unfortunately it was on a commodore 64. By the time I had gotten good enough at it to start designing my own stuff, it was obsolete. This doesn't look too far off from my commodore days! Maybe I should have kept up with it!