现在的位置: 首页 > 综合 > 正文

一个用来批改作业的批处理文件

2018年06月10日 ⁄ 综合 ⁄ 共 338字 ⁄ 字号 评论关闭

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 ..
)

抱歉!评论已关闭.