Configuring cron jobs on Windows 7

This is much easier than you may think and is especially helpful to anyone hosting a Drupal site on a Windows 7 machine. It can also be useful if you want to have your local computer initiate a cron run remotely if you're using a shared hosting package.

In order to setup a Windows 7 machine to run cron.php (or any web page you may require) at a specific time, follow the simple instructions below.

Creating a Scheduled Task

  1. Open Scheduler (type Sched into the search box and it'll appear)OR go to Start > Programs > Accessories > System Tools > Scheduled Tasks
  2. Click 'Create Task'.
  3. The Scheduled Task Wizard will appear. Give the task you wish to generate a name and a brief description if you so wish.
  4. Click the 'Actions' tab then click 'New'. Leave the top option at its default, which is 'Start Program'.
  5. In the 'Program/script' box click browse to your favourite browser and select its executable file (eg: firefox.exe)
  6. In the 'Add arguments' box put the address of your cron.php file, eg: http://www.mysite.com/cron.php or http://localhost/mysite/cron.php
  7. Go to the 'Triggers' tab and select any time once per day (or whatever frequency you prefer) then fine tune the conditions from within the 'Settings' tab. Done!
  8. Told you it was easy!