I shell a .bat file which runs a DOS app. The DOS app's output is redirected to a file. I need to read that file when the DOS app is finished.

I thought that I could tell when the DOS app finished with:

DO WHILE Dir(redirectedfile) = ""
Loop

assuming that Dir would return an empty string until the redirectedfile is completed and closed by DOS. However, it apparently "finds" the file as soon as the DOS app starts.

How can I determine that the DOS app is done?

TIA,

Don Goyette