bat文件
一个exe用于不断生成数据 (build)
另外两个exe输出结果并比较 (test1,test2)
一个文件夹存放结果(addr)
@echo off setlocal enabledelayedexpansion ::here, code1 build data, code,cod2 test exe set build=C:\Users\scientific\Desktop\code1\bin\Debug\code1.exe set test1=C:\Users\scientific\Desktop\code\bin\Debug\code.exe set test2=C:\Users\scientific\Desktop\code2\bin\Debug\code2.exe set addr=C:\Users\scientific\Desktop\test if not exist %addr% ( md %addr% ) for /l %%i in (1,1,1000) do ( cd %addr% %build% >%%i.txt %test1% <%%i.txt >output1_%%i.txt %test2% <%%i.txt >output2_%%i.txt fc output1_%%i.txt output2_%%i.txt >nul && echo >nul || echo not same %%i set /a j=%%i%%100 if !j! equ 0 ( echo %%i th ) ) pause
原文:https://www.cnblogs.com/cmyg/p/10603038.html