Windows timed cmd command line run instance of PHP file

Source: Internet
Author: User

Under Windows cmd, you can execute PHP files by Php.exe, and then write the command to bat to execute it regularly, probably more reliably than the browser's timed refresh.

The path to the Php.exe and the path to the PHP file to execute (code below):

D:\Program Files\wamp\bin\php\php5.4.6\php.exe D:\Program files\wamp\www\phpinfo.php

Saved as a bat file, you can take advantage of the scheduled tasks of Windows to execute regularly. The operation of Php.exe under CMD can be viewed at any time using the-H parameter.

>> execute PHP or refresh on Windows Server with the system's own task plan and bat matching or borrowing a specific browser to implement

Method One:


Task planning and Bat Matching
1. Add a scheduled task or write your own script in a dream background.
2. Create a new text document fill in the Bat Script command and modify the txt extension to bat.
The content format is as follows:

@echo off

REM Shutdown echo

Start C:\ "program Files" \ "Internet Explorer" \iexplore.exe http://www.skyhome.cn

REM Opens the URL address using the browser http://www.111cn.net

Ping 127.1-n >nul
Taskkill/im chrome.exe/f

rem 10 seconds (in seconds) after the end of the Chrome.exe process closes the browser (the default browser is chrome that opens with chrome)

3. Use the Winows Self-planning task tool to execute BAT scripts on a regular basis as needed.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.