0

I'm working on a script:

@Echo off
for /f "tokens=*" %%f in (filenames.txt) do set filename=%%f
echo %filename%
pause

The problem is that it only echos the last line in "flienames.txt" and I need it to do them all in order one by one.

1 Answers1

1

Here you can read more about loops in batch-file. In your case the code should look like this:

@Echo off
SETLOCAL ENABLEDELAYEDEXPANSION
for /f "tokens=*" %%f in (filenames.txt) do (
  set filename=%%f
  echo !filename!
)
pause
Community
  • 1
  • 1
gawi
  • 2,301
  • 4
  • 27
  • 39