Windows7 下 Laravel 任务调度

2018-03-08 14:15:19 阅读:6 编辑

route/console.php

Artisan::command ('test_task',function (){\Log::info ("test_task");
});

App/Console/Kernel.php

protected function schedule (Schedule $schedule)
{$schedule->command ('test_task')
     ->everyMinute ();}
#### create file task.bat
D:\wamp\bin\PHP\PHP5.6.25\php.exe E:\edison\91 yunying\artisan schedule:run 1>> NUL 2>&1

create file task.vbs --hide Windows

CreateObject ("Wscript.Shell").Run """"& WScript.Arguments (0) &"""", 0, False

计划任务 -- 添加一个任务(每分钟一次)

程序:wscript.exe
参数:"d:\task.vbs" "d:\task.bat"