I would like to follow up on my problem of providing input to a program when running in a batch file. I have two issues I would like know if others have overcome.

First, for command input, you need to provide a seperate file for the text input. The Apollo O/S provided a syntax that the commands could be taken from the same batch file. Has anyone found this capabiliy?

Second, when using input from a text file via:
Program < commands.txt
When the commands.txt file is exhausted (end of file on read), how can you recover and continue to provide interactive input ?

As we know, the Windows command processor is not as capable as Unix shells such as Bash. You can obtain and use a version of Bash for Windows.

Here is something that you can do as a stop-gap: you can read a known data file by passing the name of the file as an argument, and check for EOF as you read and process the data from the file. When EOF occurs, you switch to reading data from standard input. Terminate by typing in Ctrl+Z.