In loop FOR /F there is very good block separator delims= tokens=. But I'm frustrated that delims can hold only 1 symbol. But I want to extract from list only machines which run on 'Windows 2000' like: FOR /F "delims='Windows 2000' tokens=2" %%i in (genlist.txt) do systeminfo /s %%i File genlist.txt was produced by listing all the computers on network: @echo off FOR /F %%i in ('net view ^| find "\\"') do echo %%i