I am trying to find a list of machines in files in folders, and print out the last line of the output only.
@echo off for /f %%a in (computers.txt) do findstr /x
@echo off setlocal enableextensions disabledelayedexpansion for /f %%a in (computers.txt) do ( set "line=" for /f "tokens=*" %%b in ('findstr /xs "%%a" *') do set "line=%%b" setlocal enabledelayedexpansion echo(!line! endlocal ) pause endlocal