Output the results of two commands in parallel
Posted: 09 Oct 2021 16:15
I hope this trick can help anyone
1.bat
2.bat
Parallel.bat
1.bat
Code: Select all
@echo off
for /l %%a in (1,1,10) do echo=%%a
Code: Select all
@echo off
for /l %%a in (1,1,15) do echo=%%a
Code: Select all
@echo off
(for /f "delims=" %%a in ('1') do @echo=%%a&ping 127.1 -n 1 >nul)|cmd /v /c "(for /f "delims=" %%b in ('2') do @(set/pa=&&echo=!a! %%b||echo= %%b))&&for /l %%c in (,,,) do @set /pa=&&echo=!a!||exit /b"
pause