Discussion Locked

Looping Batch File

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I am running a program in MS-DOS. When I press esc the program quits and goes back to dos c promnt. I need to create a batch file or any other file, that would automaticly run that program again. And if I go into the program and esc out of it again,I want the batch file to pick this up and run the program again. If this is not posible with batch files, what else can I use? Can I have the batch batch file automaticly restart the computer? Any Help is appriciated. Thanks in advance.

5 replies

by tarva

You can try with some batch file like this:
=================
:start
... your program here e.g. program.exe
goto start

====================
this can be stopped only with ctrl-c combination

by arhemed

thats not gonna work, i need it constantly work, no matter how many times i go into my program and esc out of it

by timthetoolman

Hi,

I dont see what the problem is with the previous answer?

I DOES continually loop around and re-run the program if you escape out of it!?

The only thing I can thing of that might be a problem is if escaping out of it somehow kills the entire dos window.

If thats the case, you could try...

:loop
start your_program.exe
pause
goto loop

which starts your_program.exe in another process and waits until you hit return on the first window before starting another one.

Otherwise it'll loop around starting zillions of your_program.exe 's.

Is that any better?

Cheers,
Tim.

This discussion is closed to new replies.