0

I have an aspx file on my windows 2012 server, I've come from Linux servers so i'm used to cron jobs. I googled and found a lot of talk of using the Task Scheduler, but all the documentation is on Microsoft's site and is completely impossible to understand for anyone that doesn't have a PhD in English.

Can anybody that has experience help me out?

Alexander Forbes-Reed
  • 2,823
  • 4
  • 27
  • 44
  • http://www.foliotek.com/devblog/running-a-scheduled-task/ – King Friday Dec 31 '12 at 23:18
  • I was trying to avoid doing it that way. But as you would expect, just after I posted this I found an article on how to do it (http://www.appnovation.com/how-set-scheduled-tasks-windows-server-2008). But I'm wondering on how to close IE after the task is run. Do you have any ideas? – Alexander Forbes-Reed Dec 31 '12 at 23:22

1 Answers1

2

I don't know if it's possible for you to do or not, but if you take the logic from your aspx page and turn it into a Web Service, you can create a simple console application (.exe) that executes your Web Service code. The task scheduler would call the executable instead of opening a browser.

Gage Trader
  • 363
  • 2
  • 13
  • I am not sure exactly how to show an example since there isn't much coding involved - it's more of how you setup your projects and your scheduled task. Here is an example I found of setting up a web service and consuming it from a console application: http://www.codeproject.com/Articles/8257/How-to-make-a-simple-WebService-and-consume-it After you build your console app, simply place the exe on your server somewhere and setup a scheduled task to run it on the schedule you want. – Gage Trader Jan 01 '13 at 14:07
  • This is exactly what I ended up doing. Apologies for not checking back sooner. – Alexander Forbes-Reed Jan 01 '13 at 23:18