首页 > 代码库 > php定时执行任务(windows7)
php定时执行任务(windows7)
1:先写自己的php文件,这里是我的一些php文件
2:新建.bat文件
写入内容:E:\WampSever\wamp\bin\php\php5.4.12\php.exe -q E:\WampSever\task\Grab1.php E:\WampSever\wamp\bin\php\php5.4.12\php.exe 这是我的php.exe路径 E:\WampSever\task\Grab1.php 这是我的要定时运行的php文件路径提示:要是定时执行多个php文件时候只要连起来就可以
E:\WampSever\wamp\bin\php\php5.4.12\php.exe -q E:\WampSever\task\Grab1.php E:\WampSever\wamp\bin\php\php5.4.12\php.exe -q E:\WampSever\task\Grab2.php E:\WampSever\wamp\bin\php\php5.4.12\php.exe -q E:\WampSever\task\Grab3.php E:\WampSever\wamp\bin\php\php5.4.12\php.exe -q E:\WampSever\task\Grab4.php E:\WampSever\wamp\bin\php\php5.4.12\php.exe -q E:\WampSever\task\Grab5.php E:\WampSever\wamp\bin\php\php5.4.12\php.exe -q E:\WampSever\task\Grab6.php E:\WampSever\wamp\bin\php\php5.4.12\php.exe -q E:\WampSever\task\Grab7.php E:\WampSever\wamp\bin\php\php5.4.12\php.exe -q E:\WampSever\task\Grab8.php E:\WampSever\wamp\bin\php\php5.4.12\php.exe -q E:\WampSever\task\Grab9.php E:\WampSever\wamp\bin\php\php5.4.12\php.exe -q E:\WampSever\task\Grab10.php E:\WampSever\wamp\bin\php\php5.4.12\php.exe -q E:\WampSever\task\Grab11.php E:\WampSever\wamp\bin\php\php5.4.12\php.exe -q E:\WampSever\task\Grab12.php E:\WampSever\wamp\bin\php\php5.4.12\php.exe -q E:\WampSever\task\Grab13.php E:\WampSever\wamp\bin\php\php5.4.12\php.exe -q E:\WampSever\task\Grab14.php E:\WampSever\wamp\bin\php\php5.4.12\php.exe -q E:\WampSever\task\Grab15.php E:\WampSever\wamp\bin\php\php5.4.12\php.exe -q E:\WampSever\task\Grab16.php E:\WampSever\wamp\bin\php\php5.4.12\php.exe -q E:\WampSever\task\Grab17.php E:\WampSever\wamp\bin\php\php5.4.12\php.exe -q E:\WampSever\task\Grab18.php E:\WampSever\wamp\bin\php\php5.4.12\php.exe -q E:\WampSever\task\Grab19.php E:\WampSever\wamp\bin\php\php5.4.12\php.exe -q E:\WampSever\task\Grab20.php3:bat文件建立OK后就可以建立任务计划程序
触发器里面新建设置执行时间
操作里面新建浏览刚才建立的.bat文件
这是我自己计划任务的设置选项:条件设置根据自己的需求来设置
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。