views:

115

answers:

2

I have a rake task I need to run as a daily job on a Windows XP machine. I discovered the Windows "scheduled tasks" control panel. I'm trying to figure out how to get it to run my Rake task.

Two of the fields are "run" (with a browse button) and "start in". I tried to enter rake mycategory:mytask into "run" and my Rails project dir containing the Rake task into "start in". The result was a message saying the task "could not start".

How can I get set up a Windows "scheduled task" to run a Rake task?

+3  A: 

If you can build a batch file that can execute it properly I would do so, and then you can direct the batch file to run with the task.

Something like this should work:

:: Run task every hour
@call rake stats RAILS_ENV="production"
mwilliams
Success! Thanks.
Ethan
+2  A: 

Also, aside from the (correct) batch file advice above, AFAIK, you may need to run the task on an account that has a non-empty password set. Property of Scheduler.

DVK