Home  >  Article  >  Backend Development  >  cmd - php calls exec function to execute bat script? ?

cmd - php calls exec function to execute bat script? ?

WBOY
WBOYOriginal
2016-10-17 09:30:111858browse

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?

Reply content:

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>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn