Is there any way to schedule the loading of a webpage?

MoobyTheGoldenCalf

Golden Member
Jul 26, 2001
1,146
0
76
I'm in the middle of a project and I'm going to be writing a webpage that does a bunch of database record maintenance and then sends out some emails. It will work fine if the page is manually loaded, but it would be a lot better if I could schedule it to load once per day automatically. Are the any tools or anything out there that will automate web page loading? Or is there a way to write a bat file and use task scheduler? If it makes any difference, this is going to need to be run on a win2003 server running IIS. Thanks.
 

coder1

Senior member
Jul 29, 2000
433
0
0
If the purpose of this program is to do database record maintenance, why are you writing it within the confines of a web page. An application like this would be better of running as a local win32 app.
 

coder1

Senior member
Jul 29, 2000
433
0
0
Well, I guess here are a couple options for you then.

1.) You could write a VB app if you have visual studio. The vbscript your using in ASP has many similarities in syntax as vb.net (or v6) and the way you connect to your OLEDB could also be used in VB.net. If you don't have visual studio.net you could always download VB.net express edition for free (Visual Basic 2005 Express)

2.) If you want to use the web app, one way to go about this would be to create a bat file with the line start iexplore.exe "www.anandtech.com"
Of course you would put in the website that runs your app and if it is running on your local IIS then just sub the web page name with http://localhost/mywepapp.asp

Then you could call this bat file through a scheduled task within the OS.

Anyways, hope this helps
 

MoobyTheGoldenCalf

Golden Member
Jul 26, 2001
1,146
0
76
Thanks for the reply. I've never used VB express and would probably be lost if I tried it right now. Option 2 gets me halfway there, but over time I would end up with hundreds of instances of IE open on this server. I don't suppose there is a way to close down IE once you've opened it from a BAT file is there??
 

coder1

Senior member
Jul 29, 2000
433
0
0
Well, that might be more difficult. I know the Windows 98 resource kit had a kill.exe command that could be used in a batch file, but then you also run into the problem that both of these processes are not synchronized. You don't want the bat file closing the webpage in the middle of a DB update. It's hard to time two asynchronous threads to follow a synchronized event.

What you could do is after the web page is opened use the ASP command below. This would allow the one web page to stay open and refresh again at your desired interval.

<%
Response.AddHeader "Refresh", "10"
%>
 

coder1

Senior member
Jul 29, 2000
433
0
0
Another thing I really didn't thinkg about is that you probably don't even have to use the batch file at all. You could probably just call Iexplore.exe "http://localhost/mywepapp.asp" directly

I'm not sure on this since I have never tested it, but should work the same at using a .bat file
 

MoobyTheGoldenCalf

Golden Member
Jul 26, 2001
1,146
0
76
I think I figured it out. The taskkill command looks like it might work. I can just run this on my XP machine at night since it really doesn't need to be run on the server. The dbase is going to be small and it will take no more than a few seconds at most for this to do it's job. I can just make 2 bat files, 1 to open and 1 close and schedule them 15 minutes apart or so to be safe.

Thanks for your help.