Page 1 of 1
call commands using in a single line
Posted: 06 Sep 2022 00:35
by KSKwin123
how to call 2 subroutine in a same command line in an batch file
eg
call :subroutine1 && :subroutine2
Re: call commands using in a single line
Posted: 06 Sep 2022 01:57
by miskox
Re: call commands using in a single line
Posted: 06 Sep 2022 02:07
by aGerman
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
Re: call commands using in a single line
Posted: 06 Sep 2022 09:10
by KSKwin123
HI,
Single & works well. Thanks for your help.