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