Heim  >  Artikel  >  Backend-Entwicklung  >  cmd - php 调用exec函数执行bat脚本??

cmd - php 调用exec函数执行bat脚本??

WBOY
WBOYOriginal
2016-10-17 09:30:111859Durchsuche

php 调用exec执行bat脚本中的命令,为啥前一行命令还在执行中,后一行命令就执行了呢???bat小白,希望大神相告,怎么能让前一行命令执行完后接着执行后一行呢?有什么好的方法?

回复内容:

php 调用exec执行bat脚本中的命令,为啥前一行命令还在执行中,后一行命令就执行了呢???bat小白,希望大神相告,怎么能让前一行命令执行完后接着执行后一行呢?有什么好的方法?

谢邀

没看懂

start xx.exe
或者start xx.bat

php的 exec就是执行控制台的东西了 至于有什么问题 那就不是php的事了

如果要让bat中的命令顺序执行,您需要在命令前加call关键字:如:

<code>call dir
call xxxx.exe</code>
Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn