Примеры скриптов:
f in () do echo TEST %%f & copy %%f sum.in > nul & ..\a.exe & check.exe sum.in sum.out %%f.a
echo off
for f & copy f.a sum.out & if errorlevel 1 exit
echo off
for %%f in () do echo TEST f sum.in > nul & ..\a.exe & check.exe sum.in sum.out