Main > Software Forum

Writing batch files. Need some help

Pages: (1/3) > >>

Popcorrin:

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:

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:

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:

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:


--- Quote from: Popcorrin 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

--- End quote ---

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

Pages: (1/3) > >>

Go to full version