3

I have a web page on a which does some database updates (e.g. http://www.mysite.com/updates.asp). I want this page to be called automatically each day at 09:00.

I know how to schedule a task in IIS, but the process of scheduling a task requires that I select a programme to operate the task. So I'm thinking perhaps I need to make a .exe file which calls the web page, then schedule that .exe to run daily.

Is this right? If so, how do I create a simple .exe to do this? My skills are solely front end web (html/css) and classic ASP, so I've never done anything like creating a .exe before, but I'm sure it can't be too difficult as it's only doing something very simple i.e. loading a web page.

I've looked online and the only examples I can find are full asp.net examples which contain logging of schedules etc, but I'm looking for something much simpler. I just need to get the web page called once daily.

Alternatively, is there a different way I can get the scheduler to call the page without a .exe?

Many thanks for any pointers...

Dan
  • 5,836
  • 22
  • 86
  • 140
  • +1, but I think this is better placed on ServerFault. – Justin Oct 18 '10 at 12:52
  • I think your case is the reason why online schedulers exist and do well. Try http://scheduler.codeeffects.com or http://webbasedcron.com. –  Oct 07 '11 at 01:39

5 Answers5

4

An exe to send an HTTP get request would be simple to create but there are lots around that you can use, for example wget.exe from http://gnuwin32.sourceforge.net/packages/wget.htm

RedGrittyBrick
  • 3,827
  • 1
  • 30
  • 51
  • Thanks RedGrittyBrick. I'd come across that service when I've been Googling, but had discounted it as it looks like overkill - it does WAY more than I need, so I'd prefer something much lighter if possible. Thanks though. – Dan Oct 18 '10 at 13:08
2

To accomplish this using only the Windows Task Scheduler and one line of PowerShell please see this answer

Community
  • 1
  • 1
Loren Paulsen
  • 8,960
  • 1
  • 28
  • 38
1

I'm looking for an even better way to do this than I'm using right now. Currently I'm using a simple .vbs script to achieve this.

url="http://www.mysite.com/updates.asp"
Set objHTTP = CreateObject("MSXML2.XMLHTTP")
Call objHTTP.Open("GET", url, FALSE)
objHTTP.Send

In your scheduled task, call the "wscript.exe" program, and specify the full absolute path to the .vbs file as the argument.

Larry Silverman
  • 1,043
  • 1
  • 11
  • 30
0

This SuperUser.com answer is much simpler.

cmd /c start http://example.com/somePage.html

See my full post, where I comprehensively compare options and justify that the above is simple-as-possible.

  • WGET / CURL - good alternative
  • PowerShell - not recommended
  • VBScript - not recommended
Community
  • 1
  • 1
Kind Contributor
  • 17,547
  • 6
  • 53
  • 70
0

You can try a web based request scheduler like iHook, with which you could specify a HTTP request schedule via cron expression (and timezone). The good thing about a web based approach is that the complexity of maintaining the scheduler is abstracted away by the vendor. One thing to watch out is the service availability, you probably want to setup another monitor using a separate service to make sure your 3rd party scheduler service is functioning well, like datadog.

Yuming Cao
  • 935
  • 1
  • 10
  • 22