echo off set file_name=../result.txt echo > %file_name% for /D %%i in (*) do ( cd %%i echo %%i >> %file_name% if exist *.c ( if not exist asgn1.c ( copy *.c asgn1.c rem echo Incorrect File Name! >> %file_name% ) rem start compile cl asgn1.c 1>> %file_name% if exist asgn1.exe ( rem start test case rem ... ) ) else ( echo No Submission >> %file_name% ) cd .. )