Batch files: How to read a file?

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)

Leave a Comment