It turns out that there is this good thing, thanks to this blogger for sharing~
https://blog.csdn.net/wlx65003/article/details/51149196
The following is the .bat file, which is easy to use after writing it down:
duipa_single.bat
rand.exe > in.txt
my.exe < in.txt
std.exe < in.txt
my.exe < in.txt > myout.txt
std.exe < in.txt > stdout.txt
fc myout.txt stdout.txt
pause
duipai_while.bat
@echo off
:loop
rand.exe > in.txt
my.exe < in.txt > myout.txt
std.exe < in.txt > stdout.txt
fc myout.txt stdout.txt
if not errorlevel 1 goto loop
pause
goto loop