Execute PHP on Windows Server using BAT timing
There is a similar cmd and bat file on Windows and Linux, the bat file is similar to a shell file, and executing the bat file is equivalent to executing the command inside and out (and, of course, by logic), so We can use the Bat command file to implement PHP timed tasks on Windows servers. In fact, timed tasks on Windows are the same as on Linux, except in different ways and paths. Okay, here we go.
First, create a Cron.bat file in a location you think is appropriate, and then open it with a text editor (Notepad can) and write something like this:
D:\php\php.exe -q D:\website\test.php
The meaning of this sentence is to use Php.exe to execute test.php this PHP file, and the above contab, bypassing the server environment, execution efficiency is relatively high. When you are done, click Save to close the editor.
The next step is to set up a timed task to run Cron.bat. Open: "Start –> Control Panel –> Task Scheduler –> Add Task Schedule", set the time and password of the scheduled task in the Open interface, by selecting, the Cron.bat is mounted. OK, such a timed task is set up, in this timed task right-click, run, this scheduled task began to execute, to the point, will run Cron.bat processing, Cron.bat to execute PHP.
The above describes the Windows Server on the use of bat timed to execute PHP, including the aspects of the content, I hope the PHP tutorial interested in a friend helpful.