Page 1 of 1

Multiple batch files or single batch file?

Posted: 20 Jun 2011 14:32
by Acy Forsythe
I know the answer may actually depend on the task at hand, but in general practice do you...

A: Typically manage multiple tasks in a single large batch file?

B: Setup multiple batch files to handle individual tasks and then manage the process from a single main batch file?

Are there pros/cons or is it just preference?

Re: Multiple batch files or single batch file?

Posted: 20 Jun 2011 15:22
by Ed Dyreen

A is too slow, B is too fragmented, How about C, a little of both ! :P

#include Math.CMD
#include User.CMD
#include Network.CMD

A is fast, C and B are just exponentially faster, I say a good cpu is the best way to mask a bad programmer !

Re: Multiple batch files or single batch file?

Posted: 20 Jun 2011 15:29
by orange_batch
I go with A, unless I have different batch jobs that require the same resource functions. And A isn't slow, unless you're Ed. :roll:

Re: Multiple batch files or single batch file?

Posted: 20 Jun 2011 15:36
by Acy Forsythe
I've always gone with option A. With the exception that a lot of my automated tasks revolve around SQL data and displaying html indexes on the fly, so my "A" is usually required to generate and then execute dynamic scripts. So technically it's more than one batch and a few .sql scripts, but they are temporary and all the code is in one file.

Now that I've been messing with the concept of libraries I was beginning to wonder if I was just doing it "wrong" or "inefficient".

Re: Multiple batch files or single batch file?

Posted: 20 Jun 2011 15:51
by Ed Dyreen

"wrong" or "inefficient"

No you are doing great, orange seems to know everything about it, use many functions, and many calls inside a single batch, especially at places you don't have to, that should do it :D

Re: Multiple batch files or single batch file?

Posted: 20 Jun 2011 17:59
by orange_batch
Image