Schedule a task to call a web page using Task scheduler in windows
Posted January 21, 2011
on:- In: .Net | ASP.NET
- 2 Comments
Hi,
One of the requirement during the maintenance for one of the project was to call a web page iteratively on a scheduled time.
I find one interesting article posting script how to run scheduled task to call a web page using task scheduler in windows.
All you have to do is save following script in a .vbs file, and schedule it to run on windows scheduler.
Here it is:
Call LogEntry()
Sub LogEntry()
‘Force the script to finish on an error.
On Error Resume Next
‘Declare variables
Dim objRequest
Dim URL
Set objRequest = CreateObject(“Microsoft.XMLHTTP”)
‘Put together the URL link appending the Variables.
URL = “http://localhost:82/image-sitemap-generator.aspx”
‘Open the HTTP request and pass the URL to the objRequest object
objRequest.open “POST”, URL , false
‘Send the HTML Request
objRequest.Send
‘Set the object to nothing
Set objRequest = Nothing
End Sub
You can find more detail from here for implementation of this:
1 | Brian Graham
February 14, 2011 at 4:44 am
This didnt work for me…I just get errors. I took this info, pasted it in a textfile, and renamed it with the .vbs extenstion…Im on Win 7…any thoughts?
jatinkacha
February 14, 2011 at 4:50 am
Brian,
Thanks for approaching me.
Well, this experiment went fine for me in windows XP machines + windows 2K3 server. I didnt try in win 7.
Will try and let you know.