Execute ASP or ASP.Net page or code at specified time interval

G

Grant Ord

I've never found a simple answer to this yet it must be an issue for a lot of
web applications.

Basically I want to execute code in a web application at a specific time
and/or intervals (like daily at 2:00 AM).
I want this to happen regardles of whether a user is accessing the
application.

Some years ago I solved a particular instance of this issue by setting up a
Scheduled Task. The task used a command line to launch IE without an
interface and passed the URL of an ASP page as a parameter. The ASP page
contained the code I wanted to run, which ran, and then IE was closed. I
don't remember whether the ASP closed IE or the Scheduled Task did. A bit
crude I suppose but it worked just fine.
Trouble is I've lost the command I Scheduled and I can't remember the
syntax. I've tried to find IE command line syntax again but with no success.

If anyone knows what that syntax would be then I'd be grateful. I've done
numerous earches for IE comand line syntax but not turned up anything useful
- where on earth is it?

More generally is there a better way to achieve the objective? Some of my
applications are hosted by ISPs rather than being intranet based. Scheduled
Tasks aren't an option there.

Can something be set up in the ApplicationOnstart event? Would it be safe to
do?
 
A

Adrienne

Gazing into my crystal ball I observed =?Utf-8?B?R3JhbnQgT3Jk?=
I've never found a simple answer to this yet it must be an issue for a
lot of web applications.

Basically I want to execute code in a web application at a specific
time and/or intervals (like daily at 2:00 AM).
I want this to happen regardles of whether a user is accessing the
application.

Some years ago I solved a particular instance of this issue by setting
up a Scheduled Task. The task used a command line to launch IE without
an interface and passed the URL of an ASP page as a parameter. The ASP
page contained the code I wanted to run, which ran, and then IE was
closed. I don't remember whether the ASP closed IE or the Scheduled
Task did. A bit crude I suppose but it worked just fine.
Trouble is I've lost the command I Scheduled and I can't remember the
syntax. I've tried to find IE command line syntax again but with no
success.

If anyone knows what that syntax would be then I'd be grateful. I've
done numerous earches for IE comand line syntax but not turned up
anything useful - where on earth is it?

More generally is there a better way to achieve the objective? Some of
my applications are hosted by ISPs rather than being intranet based.
Scheduled Tasks aren't an option there.

Can something be set up in the ApplicationOnstart event? Would it be
safe to do?

1. Get to the desktop
2. Rightclick and choose create shortcut
3. Type in the URL and save it
4. Open up Task Scheduler
5. Browse for the shortcut you put on your desktop
6. Do the scheduling, save it and exit.

This will work for any URL. May not be the best, but it works for me.
 
E

Evertjan.

Adrienne wrote on 12 mei 2005 in microsoft.public.inetserver.asp.general:
1. Get to the desktop
2. Rightclick and choose create shortcut
3. Type in the URL and save it
4. Open up Task Scheduler
5. Browse for the shortcut you put on your desktop
6. Do the scheduling, save it and exit.

This will work for any URL. May not be the best, but it works for me.


=========== getTheUrl.vbs =========

With CreateObject("MSXML2.XMLHTTP")
.open "GET", "http://www.myOrg.org/blah/myAsp.asp", False
.send
' WScript.Echo .responseText
' un-remark the above if you want to read rendered content
End With

====================================

And schedule this getTheUrl.vbs file
[never tried that, btw]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top