(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
(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
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.
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...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>
I would probably use a scheduling program but the above should work if you can't be bothered ;)
HTH
MarkusJ
Whoops, replace
withCode:<body onLoad="java script:reloadMe()">
Code:<body onLoad="javascript:reloadMe()">
Can you give some examples of scheduling programs? Will MS's task scheduler work?
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?
Cheers
Mark
cos I'm rusty w/vb :) I could set the home page of IE to my app then have the scheduler run it.Quote:
Originally posted by MarkusJ_NZ
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]
What scheduler programms were you referring to before?
Hi again :),
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.....
Cheers
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...
Cheers
MarkusJ
Thanks! I've been pulled away from that project for hte time being but will let you know how it works out :)
Michael
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
That way it kills any asp session variables hanging around.
K... i have every thing worked out and it works great!
Thanks a million!
Glad that it worked :)
Cheers
MarkusJ
hi,
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
hi,
I think you wouldnt even need a vbs file, can leave the code as asp/html.
(if the code was asp, how can U address, say servervariable in vbs...)
I do this by making IE jump to the webpage via schedule - (this causing the asp to run on the server....)
following cmd added to the schedule with "AT".....
"C:\Program Files\Internet Explorer\IEXPLORE.EXE" http://server/page.asp
no worries,
cheers, A.J.P