I tried it this way, it worked like a charm.
Contents of batch program:
@ECHO OFF
FORMAT A:<input.txt
(blank line)
(end of file)
Contents of input.txt:
Y
(blank line)
(end of file)
If you want to hide the formatting information, try:
@ECHO OFF
ECHO Formatting floppy disk...
FORMAT A:<input.txt>nul
(blank line)
(end of file)
Keep in mind that if there are errors, the user may not see the message.
"Disk not found, abort retry ignore?"
The user will not see the error message or flashing cursor, and will not know what to press to continue. It will appear to have locked up.
I recommend allowing the format information to display on the screen.