Main > Main Forum

Making a looping batch file

(1/3) > >>

shardian:
Here is the deal:

I want to have a batch file that gives me a list of about 8 games. The first one opens by activating the batch file. When P1+P2 is hit, it exits and the next game loads up.  I want an endless cycle of this. How do I write that in a batch file?

SavannahLion:
Use a GOTO

For example

--- Quote ---:BEGINNING
Do your thing here
goto BEGINNING

--- End quote ---

Keep in mind this is an endless loop. You might need to build an :DONE and an IF statement to search for an escape.

shardian:
Well for this weekend I'm using my good desktop PC as a temp setup. I'll just get to the desktop and cancel the msdos window. The final setup will be in DOS, so I'll just shut her down without messing with it.

shardian:
Wow, that was fun! It looped alright...to infinity and beyond! Now can someone help me figure out how to add a pause between each command? I don't mean a PAUSE command (hit space to continue), but a command that would start the next command as soon as I exit the first program. I assume I would have to monitor the status of MAME running or something, right?

patrickl:
You could use the start command with a wait switch. Like:

start /wait notepad.exe

Navigation

[0] Message Index

[#] Next page

Go to full version