How to run task scheduler in windows 10 with Larav

2019-02-04 18:02发布

问题:

I just want to ask how to use it's task scheduling feature on windows machine (my local machine).

I've read it's documentation and I've notice that it's using a Cron.

Any help is truly appreciated.

回答1:

To run Laravel Scheduler in Windows 10 you need:

  1. Create batch file, like this one and save it:

cd c:\laravel-project\

c:\php5\php.exe artisan schedule:run 1>> NUL 2>&1

  1. Go to Windows 10 Task Scheduler (fast way is press Win+R and enter taskschd.msc).

  2. Click Create basic task, choose When I logon trigger and then choose Start a program -> your .bat file.

  3. Check Open properties dialog option and click Finish.

  4. In task properties click Triggers, then click New and add new trigger Repeat task every - 1 minute.

Now this task will run Laravel scheduler every one minute.



回答2:

I still did not run the schedule, the solution was just to add / d to the path in

cd c:\laravel-project\

in

cd /d c:\laravel-project\