(ASP & Win2K) How do I get my server to run an ASP script every minute? **Resolved**
(I know I am silly for posting a serious question at 3pm on a friday but...)
I need to run a page once every minute. This will be on my webserver. I was thinking that i could add it to the task scheduler or something but not sure.
thanks
michael
Last edited by msimmons; Nov 1st, 2002 at 06:13 PM.
I'm off to GalahTech, hope to see you there.
If you don't like the rules they make, refuse to play their game. -- Steve Ignorant.
Couple of ways that I can think of, use a scheduling program to schedule it or use the javascript timeout event to reload the page every minute.
Code:
<head>
<script language="javascript">
<!--
function reloadMe()
{
var the_timeout = setTimeout("Redirect();",6000);
}
function Redirect()
{
document.loaction="./ASPPAGETORUN.asp"
}
// -->
</script>
</head>
<body onLoad="javascript:reloadMe()">
<%
response.write "Heres some ASP code"
%>
</body>
Save the above example as ASPPAGETORUN.asp and then run it. every minute the javascript timeout event will fire and the page will reload itself and execute the associated ASP...
I would probably use a scheduling program but the above should work if you can't be bothered
Hi, From what I can see, the task scheduler is used to schedule applications to run at a certain time... I am not sure if you can schedule IE to run at a certain time and then go to the page to execute the ASP. If this is the case you would probably be better just running the javascript function I previously posted...
Why do you need the ASP page to run every minute? Have you thought of just making a little VB app that does what the ASP page does and then scheduling the APP via MS scheduler?
Why do you need the ASP page to run every minute? Have you thought of just making a little VB app that does what the ASP page does and then scheduling the APP via MS scheduler?
Cheers
Mark [/B]
cos I'm rusty w/vb I could set the home page of IE to my app then have the scheduler run it.
What scheduler programms were you referring to before?
I'm off to GalahTech, hope to see you there.
If you don't like the rules they make, refuse to play their game. -- Steve Ignorant.
I am pretty certain that scheduling programs can only run applications so running a ASP page directly would be a problem. You will need to create a app and then schedule the app via Windows scheduling (there's a wizard under Start-Programs-Accessories-System tools-Scheduled tasks)
Do you have a copy of VB 6? If so, I can probably whip something up real quick that will help you out.....
Here's a Zip of a VB 6 app which should do what you are after.
Just replace the Const variable sURL value to the address of the ASP page which you want called every minute.
Compile the program as an application somewhere and then use the task scheduler to run that app once. The timer on the form goes off once a minute and refreshes the ASP page...
I finaly got around to installing VB6 on this machine. It looks like it will work great One question (I'm rusty w/VB and the webbrowser thing) how do I close and then reopen the page rather than refresh it?
Thanks again!
Michael
I'm off to GalahTech, hope to see you there.
If you don't like the rules they make, refuse to play their game. -- Steve Ignorant.
well....u can use VBS files with the task scheduler.Create a vbs file with the functionality u want .U can ccess database/send emails/create files etc. in the VBS file.It is similar to an asp file.Then add it to the task scheduler.
regds,
ashay
"If you should die before me, ask if you could bring a friend."
- Stone Temple Pilots