• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 479
  • Last Modified:

How to autorun an ASP script

Hello,

I have an ASP site (MS Access DB) that allows the users to add events to a calendar and ask the calendar to send an email when the event is coming up.  I do not have access to the server except for FTP.  Is there a script I can write that will automatically run an ASP page once a day?

Thank you!
0
Gqbed
Asked:
Gqbed
  • 3
  • 2
  • 2
  • +1
1 Solution
 
hongjunCommented:
0
 
Lee W, MVPTechnology and Business Process AdvisorCommented:
Write a web page that does this on load.  Then setup a Scheduled task on your PC to run an instance of Internet Explorer to load the page.
0
 
hongjunCommented:
[With Courtesy of Silvers5]


How do I schedule ASP files?


Use the AT command and Windows Scripting Host to schedule a VBS file at certain intervals.
 
First, change the ASP to a VBS file. This is accomplished by (1) changing the extension to VBS; (2) changing all server.createobject calls to createobject; and, (3) removing all <%%> delimiters and any browser-destined code (for example, response.write statement or client-side HTML). I didn't run into any further complications, but YMMV.
 
You store the VBS file in the filesystem, and use the AT command to schedule it (this actually schedules its execution with NT's schedule service). At a command prompt, you can use AT by itself to see a list of tasks currently in the schedule. You can use AT /? to find out all its syntax possibilities.
 
For example, to get a file to run every weekday at 9:00 am, I launch this batch file (the first line clears existing entries):
 
    at /delete /y
    at 9:00 /every:m,t,w,th,f d:\net\shared\getdata.vbs
 
 
 
Notice there is no web server involved; the file is accessed directly through the file system. Once I got over the "a user has to be logged in" and "the tasks have to be reset when rebooted" hurdles (both of which I believe are problems with the particular machine that is not under our control), all has been running fine for me.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
hongjunCommented:
You can also try the Windows Scheduler
0
 
aprestoCommented:
you could query the databse with a recordset and use an IF statement to response.redirect when an event occurs:

SQL = "SELECT * FROM events WHERE event <=(date()+5)"

rs.open sql, conn

If NOT rs.eof Then
       response.redirect "Emailpage.asp"
End IF

this way if any events are picked up where the date of the event is withing the next 5 days it will redirect to the page you want.  Is this anything near what you are looking for?
0
 
aprestoCommented:
This is assuming you are using a database to hold the event dates
0
 
GqbedAuthor Commented:
Sorry for the delayed response.

hongjun, your answer about the AT seems to be what I need, however, I do not totally have a grasp on the concept.  I understand the changing to vbs, no problem there.  Its the AT command portion I don't follow.  I will look for more information on it, but if you could provide more I would really appreciate it!

I can not use windows scheduler b/c I can only FTP up to the server and the server is not in my possession.  

Thanks for all the help!
0
 
GqbedAuthor Commented:
I totally skipped over the "run a batch file" portion of the accepted answer.  So yes, I do know what to do and it is exactly what I was looking for.  Thank you.
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 3
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now