Using Windows Scheduler to call an URL at specific interval
Hi,
I have used windows scheduler a lot of time while working with Sharepoint. Most of the time this was used to run some console application (which would work in off peak time to do some data management). But few days back, I had a requirement where by I wanted to schedule a windows scheduler to make a call to the page. The page would internally do some work on the load event.
But windows scheduler would not take the URL or a shortcut to the URL as a way to be scheduled. It needs an application/ batch file etc to be scheduled. So I had to think of a different way to either schedule it in windows scheduler or some other way to schedule the task of calling the web page.
Then with some goggle and help from friend I found a simple way to schedule calling a webpage from the windows scheduler. The solution is described below.
First we need to create a .vbs file. In the vbs file write the following code and save the file.
Option Explicit
Dim objIEA
Set objIEA = CreateObject("InternetExplorer.Application")
objIEA.Navigate "http://www.VikramLakhotia.com"
objIEA.visible = true
While objIEA.Busy
Wend
objIEA.Quit
Set objIEA = Nothing
The above code is opening an object of Internet explorer, opening the prescribed page and then also closing the internet explorer object.
Next create a batch file (.bat file) to execute the vbs file. Below is the code for batch file and save the file.
cscript.exe "FullPath_of_the_VBS_File\IE.VBS"
Now you can easily schedule the batch file which internally calls the vbs file and which calls the Provided URL with Internet Explorer object.
Regards