rem one way to find the version of a file for /f "tokens=2 delims= " %%G in ('type info.txt ^| findstr /B /C:"image"') do ( IF "%%G"=="a" call a.bat IF "%%G"=="b" call b.bat ) rem or like this rem for /f "tokens=2 delims= " %%G in ('type info.txt ^| findstr /B /C:"image"') do call %%G.bat