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: Writing batch files. Need some help  (Read 1725 times)

0 Members and 1 Guest are viewing this topic.

Popcorrin

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 858
  • Last login:March 06, 2022, 11:11:43 am
Writing batch files. Need some help
« on: September 27, 2004, 06:18:52 pm »
I have limited experience writing batch files and I need some advice on how to get one to work like I want it.  

What I want to do is be able to start 2 programs via a batch file and the problem that I am running into is that the 1st program starts fine but the 2nd program won't load until I exit out of the 1st program.
Is there anyway around this?  Thanks

Druin

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 180
  • Last login:May 10, 2009, 02:30:37 am
  • I'm a llama!
Re:Writing batch files. Need some help
« Reply #1 on: September 27, 2004, 06:38:13 pm »
That's how batch files work!  Sequential execution of commands just like a person would enter one after another, but automated.
So about the only thing I can think of off hand to do is not use a batch file for the program launching, but make or see if exists, a program that will just let you shell and run other programs, then maybe you can run that, and it will shell to run program 1 and then shell to run program 2, and may do it simultaneously?

I just tried shelling to DOS (Haven't said that in almost  a decade) and running CMD (command.com?) to see if I can open a shell that way and still get back to the prompt while it runs..no good... I was at c:\mame and I typed:
cmd /C mame pacman  
and it ran the game but sat waiting until I quit mame, then it let me issue another command.

So I think you have to find or write a program to launch multiple things.

DaemonCollector

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 443
  • Last login:December 26, 2009, 07:02:16 pm
  • All your base are belong to us.
Re:Writing batch files. Need some help
« Reply #2 on: September 27, 2004, 06:41:58 pm »
You won't be able to launch 2 programs simultaniously in a batch file as they are layover from DOS. To run 2 programs at once you need multithreading, and DOS can't do that without some hefty extensions.

SirPoonga

  • Puck'em Up
  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 8190
  • Last login:August 18, 2025, 08:28:46 pm
  • The Bears Still Suck!
Re:Writing batch files. Need some help
« Reply #3 on: September 27, 2004, 07:14:05 pm »
I thought batch files were async when running external programs from within the batch file..

What are you trying to do?  What two programs?  Why do you need to do this?  There might be a better way...

creatine28

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 481
  • Last login:July 26, 2012, 03:41:48 pm
  • Which way to the Arcade?
Re:Writing batch files. Need some help
« Reply #4 on: September 27, 2004, 07:22:21 pm »
I have limited experience writing batch files and I need some advice on how to get one to work like I want it.  

What I want to do is be able to start 2 programs via a batch file and the problem that I am running into is that the 1st program starts fine but the 2nd program won't load until I exit out of the 1st program.
Is there anyway around this?  Thanks

Here's a good page with a bunch of DOS batch files, maybe something here will help?


http://esca.atomki.hu/simtel/msdos/batchutl.html
« Last Edit: September 27, 2004, 07:22:48 pm by creatine28 »

Thenasty

  • Trade Count: (+17)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4420
  • Last login:Yesterday at 01:25:13 am
    • Thenasty's Arcademania Horizontal/Vertical monitor setup.
Re:Writing batch files. Need some help
« Reply #5 on: September 27, 2004, 08:52:52 pm »
write 2 batch program and shove it in the START folder.  ;D
Thenasty's Arcademania Horizontal/Vertical setup.
http://forum.arcadecontrols.com/index.php?topic=26696.0

Free VGA Breakout Cable
http://forum.arcadecontrols.com/index.php?topic=38228.0

Ultimate All in One Coin Mech write up (Make your own)
http://forum.arcadecontrols.com/index.php?topic=19200.0

Popcorrin

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 858
  • Last login:March 06, 2022, 11:11:43 am
Re:Writing batch files. Need some help
« Reply #6 on: September 27, 2004, 10:23:03 pm »
I thought batch files were async when running external programs from within the batch file..

What are you trying to do?  What two programs?  Why do you need to do this?  There might be a better way...

Thanks for all the responses.  I was wanting to use a batch file as shell that would load mamewah and also powerstrip.

DaemonCollector

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 443
  • Last login:December 26, 2009, 07:02:16 pm
  • All your base are belong to us.
Re:Writing batch files. Need some help
« Reply #7 on: September 27, 2004, 10:32:09 pm »
maybe a VBScript?

DougHillman

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 292
  • Last login:September 13, 2004, 07:39:18 pm
Re:Writing batch files. Need some help
« Reply #8 on: September 28, 2004, 08:49:08 am »
How about sticking Powerstrip in the Local Machine/Software/Microsoft/Windows/Current Version/Run section of the registry?

If you can't be a good example at least try to be a horrible reminder.

Popcorrin

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 858
  • Last login:March 06, 2022, 11:11:43 am
Re:Writing batch files. Need some help
« Reply #9 on: September 28, 2004, 09:28:13 am »
How about sticking Powerstrip in the Local Machine/Software/Microsoft/Windows/Current Version/Run section of the registry?



Would it still get loaded even though I'm using mamewah as shell?

ries

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 20
  • Last login:April 29, 2006, 04:29:51 pm
  • MAME junkie for years
    • My personal website
Re:Writing batch files. Need some help
« Reply #10 on: September 28, 2004, 02:40:37 pm »
If you want to start seperate programs from batch files do this;


@echo off
start program1.exe
program2.exe


the built in start program will open another window and execute program1.exe.

"help start" in a command windows gives this help screen, you can use it to start programs with different priorities etc.

Starts a separate window to run a specified program or command.

START ["title"] [/D path] [/I] [/MIN] [/MAX] [/SEPARATE | /SHARED]
      [/LOW | /NORMAL | /HIGH | /REALTIME | /ABOVENORMAL | /BELOWNORMAL]
      [/WAIT] [/B] [command/program]
      [parameters]

    "title"     Title to display in  window title bar.
    path        Starting directory
    B           Start application without creating a new window. The
                application has ^C handling ignored. Unless the applicatio
                enables ^C processing, ^Break is the only way to interrupt
                the application
    I           The new environment will be the original environment passe
                to the cmd.exe and not the current environment.
    MIN         Start window minimized
    MAX         Start window maximized
    SEPARATE    Start 16-bit Windows program in separate memory space
    SHARED      Start 16-bit Windows program in shared memory space
    LOW         Start application in the IDLE priority class
    NORMAL      Start application in the NORMAL priority class
    HIGH        Start application in the HIGH priority class
    REALTIME    Start application in the REALTIME priority class

remember to spice things up use "title" to set the windows title of the command prompt and a nice "color"  command in the beginning of the batch to set the background and font color of the command prompt window...

« Last Edit: September 28, 2004, 02:43:26 pm by ries »

Popcorrin

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 858
  • Last login:March 06, 2022, 11:11:43 am
Re:Writing batch files. Need some help
« Reply #11 on: September 30, 2004, 08:35:08 am »
Thanks Ries.  Looks like I should be able to do what I want with the options you gave me.  :)

I was just curious does anyone know if powerstrip would get loaded if I put it in the registry as DougHillman suggested even though I am using mamewah as shell?