Tom Del Rosso
2024-05-12 22:20:37 UTC
Is there a way to give an *external* command "any key" input without
using a macro utility?
Years ago there was some mention of using START /B but I can't find an
example. The experiment below is just confusing with the sequence of
output and input all mixed up, but both PAUSE commands still need input.
And what's needed is to give input to an external command. Piping echo
doesn't always work.
@echo off
echo TOP OF FILE
if "%~1"=="JUMP" goto :%2
echo FIRST RUN
START "SUBC" /B "%~0" JUMP SUBC
echo 1
pause
echo 2
exit
:SUBC
echo 3
pause
echo 4
exit
using a macro utility?
Years ago there was some mention of using START /B but I can't find an
example. The experiment below is just confusing with the sequence of
output and input all mixed up, but both PAUSE commands still need input.
And what's needed is to give input to an external command. Piping echo
doesn't always work.
@echo off
echo TOP OF FILE
if "%~1"=="JUMP" goto :%2
echo FIRST RUN
START "SUBC" /B "%~0" JUMP SUBC
echo 1
pause
echo 2
exit
:SUBC
echo 3
pause
echo 4
exit