I am actually writing a little PHP script, in order to retrieve files in folder on a FTP server and download them locally. Another script put those file in the server.
So here's my question : how can I write a batch file that will execute the first php script, then run a program (a game in this case). When the game is closed, execute the second script.
So it will be this process :
- When run the batch file, execute the first script (get file)
- When all files are downloaded, run the programm (
game.exe
) - After game closing, execute the second script (put file)
I think at a .bat
file, but maybe there is an another solution.
Thanks is advance ! Telest.
EDIT :
Thanks for your answer.
Google gives me this post : How to wait for a process to terminate to execute another process in batch file.
I found that I can use /W
in order to wait the program ends.
But /W
seems not working. Tried /WAIT
but no success.
Here is my batch file :
PHP C:\Users\PHProjects\test1.php
START /WAIT /B chrome.exe
PHP C:\Users\PHProjects\test2.php
PAUSE
(test1.php & test2.php are just dummy echo).
And the console result :
Chrome executes well, but test2 too
As you can see, Chrome executes well, but so do test2.php.
Is something wrong here ?
Thanks.