Home > Article > Backend Development > cmd - php calls exec function to execute bat script? ?
php calls exec to execute the command in the bat script. Why is the previous line of command still being executed, but the next line of command is executed? ? ? Bat Xiaobai, I hope someone can tell me, how can I make the previous line of command execute and then execute the next line? have any good ways?
php calls exec to execute the command in the bat script. Why is the previous line of command still being executed, but the next line of command is executed? ? ? Bat Xiaobai, I hope someone can tell me, how can I make the previous line of command execute and then execute the next line? have any good ways?
Thanks for the invitation
I don’t understand
start xx.exe
or start xx.bat
PHP’s exec is what executes the console. As for any problems, it’s not about PHP
If you want the commands in bat to be executed sequentially, you need to add the call keyword before the command: such as:
<code>call dir call xxxx.exe</code>