how to call 2 subroutine in a same command line in an batch file
eg
call :subroutine1 && :subroutine2
call commands using in a single line
Moderator: DosItHelp
Re: call commands using in a single line
Maybe
?
or maybe
Saso
Code: Select all
call :sub1&call :sub2
or maybe
Code: Select all
(call :sub1)&(call :sub2)
Re: call commands using in a single line
Yeah, the && is like a conditional command concatenation. Only if :subroutine1 returns errorlevel 0 :subroutine2 will be called. So a single & might be the better choice.
However, having both call commands in one line does not mean that the subroutines are running asynchronously (in parallel). They are still executed one after the other.
Steffen
However, having both call commands in one line does not mean that the subroutines are running asynchronously (in parallel). They are still executed one after the other.
Steffen
Re: call commands using in a single line
HI,
Single & works well. Thanks for your help.
Single & works well. Thanks for your help.