Search code examples
batch-filedos

DOS FOR /F Syntax Error


I have a text file 'infos.txt' that I am parsing with a FOR /F statement. Under windows DOS environment this works as intended, but my target is Native DOS. When run from a DOS environment I receive a syntax error. I have written it with %i %%i to no avail. This should be pretty simple. Any clues? Again, this does work as intended from a CMD prompt in windows, but neither in VirtualBox DOS or Booting to DOS via USB and running the bat file.

My delimiter is =

@ECHO OFF

FOR /F "tokens=2 delims==" %%i in (infos.txt) do echo.%%i

Solution

  • FOR /F is an NT enhancement not available on DOS.