Monday, May 17, 2010

How to Create Scheduled Tasks By Using .aspx Page

Apart from job scheduling in sql server, one can do same scheduling by using aspx page also.


You can create scheduled tasks by using .aspx files by scheduling your .aspx files to run using iexplore.exe or firefox.exe


Step 1 :
Start –> Control panel –> Scheduled Tasks –> Add scheduled task
Then, browse for your .aspx file and select it.


Step 2 :
In wizard of creating scheduling >> run >> your code should be like


For IE:

“C:\Program Files\Internet Explorer\IExplore.exe” http://127.0.01/ScheduleMyTask.aspx”


For Mozilla:

“C:\Program Files\Mozilla Firefox\firefox.exe” http://127.0.0.1/ScheduleMyTask.aspx”



Step 3:
Select your date and time to run with daily/weekly etc option.
And complete wizard. Now your scheduling is done but you need to close browser after completing scheduling


Step 4:
Create batch file(.bat) from command prompt or notepad and write


For IE

“taskkill /IM iexplore.exe”

For Mozilla

“taskkill /IM firefox.exe”

also set this file for sheduling.

Time difference between step 3 and step 4 should be atleast 2-3 minute.

No comments:

Post a Comment