Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: Making a looping batch file  (Read 1694 times)

0 Members and 1 Guest are viewing this topic.

shardian

  • Saint is the evil mastermind
  • Trade Count: (+23)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 9218
  • Last login:August 21, 2015, 03:11:31 pm
  • Friends don't let friends build frankenpanels...
Making a looping batch file
« on: February 06, 2009, 01:01:58 pm »
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

  • Wiki Contributor
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5986
  • Last login:December 19, 2015, 02:28:15 am
Re: Making a looping batch file
« Reply #1 on: February 06, 2009, 01:12:24 pm »
Use a GOTO

For example
Quote
:BEGINNING
Do your thing here
goto BEGINNING

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

  • Saint is the evil mastermind
  • Trade Count: (+23)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 9218
  • Last login:August 21, 2015, 03:11:31 pm
  • Friends don't let friends build frankenpanels...
Re: Making a looping batch file
« Reply #2 on: February 06, 2009, 01:21:40 pm »
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

  • Saint is the evil mastermind
  • Trade Count: (+23)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 9218
  • Last login:August 21, 2015, 03:11:31 pm
  • Friends don't let friends build frankenpanels...
Re: Making a looping batch file
« Reply #3 on: February 06, 2009, 01:48:37 pm »
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

  • I cannot know for certain which will be tastiest
  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4614
  • Last login:August 27, 2021, 09:25:30 am
  • Yo momma llama
    • PocketGalaga
Re: Making a looping batch file
« Reply #4 on: February 06, 2009, 02:18:50 pm »
You could use the start command with a wait switch. Like:

start /wait notepad.exe
This signature is intentionally left blank

shardian

  • Saint is the evil mastermind
  • Trade Count: (+23)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 9218
  • Last login:August 21, 2015, 03:11:31 pm
  • Friends don't let friends build frankenpanels...
Re: Making a looping batch file
« Reply #5 on: February 06, 2009, 03:01:30 pm »
Adding /wait in there worked like a charm. Sweet!

To be safe, I also threw in a pause function. Last thing I need is to have the boss walk in while I'm frantically trying to shut down a rampant arcade program.  :dizzy:

patrickl

  • I cannot know for certain which will be tastiest
  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4614
  • Last login:August 27, 2021, 09:25:30 am
  • Yo momma llama
    • PocketGalaga
Re: Making a looping batch file
« Reply #6 on: February 06, 2009, 04:25:41 pm »
I loved how old games sometimes had a "boss screen'". By that I don't mean a boss level, but you'd press F10 or something and some spreadsheet would appear while the game paused.
This signature is intentionally left blank

CheffoJeffo

  • Cheffo's right! ---saint
  • Wiki Master
  • Trade Count: (+2)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 7784
  • Last login:July 14, 2025, 12:11:49 pm
  • Worthless button pusher!
Re: Making a looping batch file
« Reply #7 on: February 06, 2009, 05:08:41 pm »


 :applaud:
Working: Not Enough
Projects: Too Many
Progress: None

patrickl

  • I cannot know for certain which will be tastiest
  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4614
  • Last login:August 27, 2021, 09:25:30 am
  • Yo momma llama
    • PocketGalaga
Re: Making a looping batch file
« Reply #8 on: February 06, 2009, 05:15:10 pm »
You're so going to get in trouble with that avatar. Don't mess with the Xohan!

BTW did you have any luck with that ad?
This signature is intentionally left blank

Ginsu Victim

  • Yeah, owning a MAME cab only leads to owning real ones. MAME just isn't good enough. It's a gateway drug.
  • Trade Count: (+10)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 10092
  • Last login:June 28, 2025, 10:45:55 pm
  • Comanche, OK -- USA
Re: Making a looping batch file
« Reply #9 on: February 06, 2009, 05:15:51 pm »
So you just settled for the first one that popped up on google? ;)

I was trying to find one of the fake spreadsheet ones.

CheffoJeffo

  • Cheffo's right! ---saint
  • Wiki Master
  • Trade Count: (+2)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 7784
  • Last login:July 14, 2025, 12:11:49 pm
  • Worthless button pusher!
Re: Making a looping batch file
« Reply #10 on: February 06, 2009, 05:18:58 pm »
LSL is a classic and was the only game that I ever used the Boss Key on, hence the mention here.

What's wrong with my avatar ? Has it been cross-linked again ? I'd better look into getting that fixed !

EDIT: OK, Gins, THAT is right over the top. What's the over/under on how long that stays there ?

« Last Edit: February 06, 2009, 05:21:33 pm by CheffoJeffo »
Working: Not Enough
Projects: Too Many
Progress: None