, :
call :func | more
exit /b
:func
echo line1
echo line2
exit /b
-
setlocal EnableDelayedExpansion
set var=Line2
( echo Line1
echo !var! ) | more
( )
SO: , ?
CALL, ( )
call echo Hello > output.txt
CALL, .
CALL
SO: CMD.EXE? ( 6)
set "myCmd=echo 1 & echo 2"
call %%myCmd%%
%% , %myCmd%, , & CALL .
- (- )
set "myCmd=echo Line1"
call (%%myCmd%%)
, , 1.bat
echo echo Hello > 1.bat
set "myCmd=echo Line1 && echo Line2"
call (%%myCmd%%)
echo End
dostips: CALL me,
, CALL - , .