Hi Magento friend today's i'm share How to Cron Setup on Windows Magento 2
First of all, find location of php.exe – Generally where Xampp is installed, it’s in Drive:\xampp\php e.g c:\xampp\php
1) Go to a folder and create a file named magentocron.bat
2) Edit this file and paste 3 lines shown below:
C:\xampp\php\php.exe C:\xampp\htdocs\magento\bin\magento cron:run
C:\xampp\php\php.exe C:\xampp\htdocs\magento\update\cron.php
C:\xampp\php\php.exe C:\xampp\htdocs\magento\bin\magento setup:cron:run
3) Save the file, open command prompt and enter following command:
schtasks /create /sc minute /mo 5 /tn Magento\Cron /tr path\to\bat\file\magentocron.bat
- Now click on Start –> Control Panel –> Administrative Tools –> Task Scheduler.
- Expand Task Schedule Library from the left hand column and click Magento.
- Select Cron from the middle pane, click properties from the right pane under selected items.
- Under Security Options, click the Change User or Group button.
- Now in the current window, enter System username in the object name box and click check names. Click OK to close the User window, and OK to close the Cron properties Window, and close Task Scheduler.
Cron job setup is successful and it will run every 5 minutes.
php bin/magento cron:run
.png)