windowsdummy
windowsdummy

Reputation: 41

Set PHP cron job on windows server 2003

I am using Windows server 2003, IIS6, php and mysql. I have a problem setting the cronjob using built in schedule task feature in Windows OS.

I need your guys help. Please advise.

Upvotes: 4

Views: 9063

Answers (3)

Greg Ellis
Greg Ellis

Reputation: 1965

if you would like to run the scheduled task every minute you have to set it up through the command like as follows:

schtasks /create /sc minute /mo 1 /tn "my task" /tr "C:\Program Files\php5\php.exe c:\wwwroot\inetpub\website\myfile.php?task=fetch"

This will let you run the task each minute. There is no way to do this through to the task scheduler gui to my knowledge so I just wanted to share this solution.

Upvotes: 11

Andy
Andy

Reputation: 50540

You call

php.exe cronjob.php

Upvotes: 2

user257111
user257111

Reputation:

You'll need to call php.exe as the interpreter with the path to the script as its argument, example:

"c:\program files\php5\php.exe" c:\cronscripts\cronjob.php

That should work.

Upvotes: 3

Related Questions