1.

Solve : W.2K batch scripting help please.?

Answer»

I want to execute multiple programs in sequence. The programs are stored in a directory named D:\Progfils. I also want to ensure that a second and SUBSEQUENT PROGRAM is not started before the previous one has ended. Can this be done?

My code so far:
Code: [Select]@echo off
cls

: Set variable for Progfils directory
Set progfils=d:\Progfils\

: Create program file names list in alpha sequence..
DIR /on/b %progfils% > d:\temp\filename.txt

: Start program sequence..
FOR /F %%a in (d:\temp\filename.txt) do start %progfils%\a%%

At this point I need some coding to ensure that the second and subsequent program does not start before the previous one has completed. PLEASE indicate what command will achieve this.

Thanks.in a sequence like such in such file 1st and so in so file 2nd
or just all of the programs togther?Sorry, I really don't understand your question.

The programs are to be run in alpha sequence from A to Z but program B must not be started before program A has finished, program C must not be started before program B has finished etc... Only one program is to run at any time.
ThanksTry adding the /WAIT to your START command. Like this:
Code: [Select]FOR /F %%a in (d:\temp\filename.txt) do start /WAIT %progfils%\a%%Thank you, that looks like what I need.

Edit: Yes, worked like the PROVERBIAL charm, thanks again.

Alf.



Discussion

No Comment Found