---
title: "How to Set up Magento 2 Cron in Xampp for Windows"
url: "https://magecomp.com/blog/set-up-magento-2-cron-in-xampp-windows/"
date: "2016-09-21T17:05:25+00:00"
modified: "2025-02-22T10:29:04+00:00"
author:
  name: "Dhiren Vasoya"
  url: "https://magecomp.com/"
categories:
  - "How To"
  - "Magento 2"
word_count: 363
reading_time: "2 min read"
summary: "Cron jobs or scheduled tasks in Magento are enabled in order to perform some periodic operation on timely basis. Cron jobs need to be setup for following services and operations to work on specific..."
description: "Detailed tutorial on setting up Magento 2 cron in Xampp for windows by MageComp."
keywords: "How To, Magento 2"
language: "en"
schema_type: "Article"
related_posts:
  - title: "How to Make Purchase Order Number Field Optional in Magento 2?"
    url: "https://magecomp.com/blog/make-purchase-order-number-field-optional-magento-2/"
  - title: "Magento 2 Store Management Made Easy with Admin Action Login Extension"
    url: "https://magecomp.com/blog/magento-2-admin-action-login-extension-integration-and-guide/"
  - title: "Magento 2: How to Delete Categories using Root Script by Category IDs"
    url: "https://magecomp.com/blog/magento-2-delete-categories-using-root-script-by-category-ids/"
---

# How to Set up Magento 2 Cron in Xampp for Windows

_Published: September 21, 2016_  
_Author: Dhiren Vasoya_  

![How to Set up Magento 2 Cron in Xampp for Windows](https://magecomp.com/blog/wp-content/uploads/2016/09/How-to-Set-up-Magento-2-Cron-in-Xampp-for-Windows-1024x332.webp)

Cron jobs or scheduled tasks in Magento are enabled in order to perform some periodic operation on timely basis. Cron jobs need to be setup for following services and operations to work on specific date and time,

[![hyva theme development](https://magecomp.com/blog/wp-content/uploads/2025/02/hyva-theme-development-CTA-4.webp)](https://magecomp.com/services/hyva-theme-development/)

they are:

- Re-indexing
- Catalog price rules
- Sending newsletters
- Generating Google sitemaps
- Customer notifications or alert messages
- Auto update currency rates
- Scheduled database log cleanups
- Cache cleanups

In Magento 2, three cron jobs required to be run. As windows doesn’t have cron, we need to use a bat file and configure it to run as a scheduled task as shown below:

1. 1. First of all, find location of php.exe – Generally where Xampp is installed, it’s in Drive:\xampp\php e.g c:\xampp\php
    2. Go to a folder and create a file named mycron.bat
    3. Edit this file and paste 3 lines shown below:

```
php_pathphp.exe magento_rootbinmagento cron:run
php_pathphp.exe magento_rootupdatecron.php
php_pathphp.exe magento_rootbinmagento setup:cron:run
```

[![Hire Magento Programmer](https://magecomp.com/blog/wp-content/uploads/2025/02/Hire-Magento-Programmer-CTA-4.webp)](https://magecomp.com/services/hire-magento-programmer/)

For example, mycron.bat looks as follows:
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
![cron-commands](https://magecomp.com/blog/wp-content/uploads/2016/09/cron-commands.png)

1. 1. Save the file, open command prompt and enter following command: ```
        schtasks /create /sc minute /mo 5 /tn MagentoCron /tr path_t_bat_filemycron.bat
        ```
    2. Now click on Start –> Control Panel –> Administrative Tools –> Task Scheduler.

![process-set-up-magento-2-cron-in-xampp-for-windows](https://magecomp.com/blog/wp-content/uploads/2016/09/Process-set-up-Magento-2-Cron-in-Xampp-for-Windows.png)

1. Expand Task Schedule Library from the left hand column and click Magento.
2. Select Cron from the middle pane, click properties from the right pane under selected items.
3. Under Security Options, click the Change User or Group button.
4. 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.
5. Cron job setup is successful and it will run every 5 minutes.

[![Magento version upgrade](https://magecomp.com/blog/wp-content/uploads/2025/02/Magento-2-Version-Upgrade-CTA-3.webp)](https://magecomp.com/services/magento-upgrade-services/)

Let me know if you suffering from any issues while setting up cron. I’ll be there to fix it for you.


---

_View the original post at: [https://magecomp.com/blog/set-up-magento-2-cron-in-xampp-windows/](https://magecomp.com/blog/set-up-magento-2-cron-in-xampp-windows/)_  
_Served as markdown by [Third Audience](https://github.com/third-audience) v3.5.3_  
_Generated: 2026-09-18 05:19:18 UTC_  
