Batch files: How to read a file

batch-filefile

How you can read a file (text or binary) from a batch file? There is a way to read it in a binary mode or text mode?

Best Solution

Under NT-style cmd.exe, you can loop through the lines of a text file with

FOR /F %%i IN (file.txt) DO @echo %%i

Type "help for" on the command prompt for more information. (don't know if that works in whatever "DOS" you are using)