Question

Automated running ASP page

Asked by: daniel_c

Is there any possibility to run an asp page (with no user interface at all) automatically (background process)?
I mean, like put it in Windows Scheduler and run it every one hour, or on some specific interval time?

I want this ASP page is still able to run even though people log off from the Web Server (Is it possible to insert it in IIS service? *really have no idea about this, but IIS Service is running all the time as long as the machine is on, even though user has logged off*)

Another point to consider is that this ASP page file should run on SSL.

I'll add the point if I get the satisfaction answer or solution.


Thanks in advance,


Daniel

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2001-05-30 at 16:06:26ID20127261
Topic

Active Server Pages (ASP)

Participating Experts
4
Points
100
Comments
17

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. SSL and ASP
    Hi All, Need a bit of info........ Any issues with ASP and SSL. In know that on a secure page all your images and external files need to be served securely, but is there any issues with ASP stuff like Session variables, the connection object, connection to a database etc? ...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: dgorinPosted on 2001-05-30 at 17:12:21ID: 6139581

A few ideas

1.  Use a host that provides a scheduler, like www.crystaltech.com.

2.  Get, or write, a server component to run a page on a timer.

3.  Have the server AT or task scheduler run a process that accesses your page.

4.  Use a client-side program that calls your page based on the client side scheduler.

 

by: robbertPosted on 2001-05-30 at 22:42:54ID: 6140259

Use the Windows Task Scheduler (or any scheduler) to run a .vbs (VBScript) file, i.e., containing the following code:

<%  @LANGUAGE=VBSCRIPT %><%  Option Explicit %><!-- #include file="asptearinclude.asp" --><html><head>       <title>Simple SSL</title></head><body bgcolor=#ffffff>

<%Dim xObj, strResult, bErrors
' create the objectSet xobj = CreateObject("SOFTWING.ASPtear")
On Error Resume Next
' do a simple SSL get (assumes CA is known, and CN is OK)strResult = xobj.Retrieve("https://www.zauner.at/", Request_GET, "", "", "")
bErrors = HandleError()
If Not bErrors Then
       Response.Write "SSL document was retrieved successfully!"
End If%>

</body></html>


AspTear is here: http://www.alphasierrapapa.com/ComponentCenter/AspTear
and documented (incl. managing client certificates) at: http://www.alphasierrapapa.com/ComponentCenter/AspTear/help

 

by: robbertPosted on 2001-05-30 at 22:44:22ID: 6140262

Sorry, that was ASP / HTML code. - Pure VBScript:

Dim xObj, strResult, bErrors
' create the objectSet xobj = CreateObject("SOFTWING.ASPtear")
On Error Resume Next
' do a simple SSL get (assumes CA is known, and CN is OK)xobj.Retrieve("https://www.zauner.at/", Request_GET,
"", "", "")

 

by: kahwooPosted on 2001-05-31 at 03:56:09ID: 6140976

listening...

 

by: daniel_cPosted on 2001-05-31 at 05:50:35ID: 6141362

Hmm... Robbert, your idea is interesting.
So, is ASPTear the only solution to do that?

Let me try it! :)

 

by: robbertPosted on 2001-05-31 at 13:03:47ID: 6143162

> So, is ASPTear the only solution to do that?

There is a number of HTTP components, but they more than seldomly support HTTPS. -- Implementing SSL is rocket-science (for an average VB programmer). -- I have an article and VB sample code for that, using a C++ DLL, but this one is rare, too...

 

by: daniel_cPosted on 2001-05-31 at 16:57:18ID: 6143905

Robbert, I have tested ASPTear.
I made one asp page under SSL. This asp file actually use CDONTS just to send email to me notify that it works.

Then I created another VBS that call the ASP page file. It worked well on the first try. It sent me an email, but after 2nd, 3rd, 4th... and so on, no more email sent to me.

Is it just working for the 1st time only?

 

by: daniel_cPosted on 2001-05-31 at 16:58:02ID: 6143910

The VBS file using ASP tears to call the page under SSL

 

by: Silvers5Posted on 2001-06-01 at 05:57:18ID: 6145784

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.
 

you can also open it in a browser window with a refresh tag..

 

by: daniel_cPosted on 2001-06-01 at 09:05:00ID: 6146575

Silver5:
This ASP file has to be run under SSL (since it is related with some credit card processing, and I'm using CyberCash to do this, and CyberCash can only be run under SSL).

So, are you sure that it can be run under Windows Scripting Host?

 

by: robbertPosted on 2001-06-02 at 08:37:12ID: 6148817

> It sent me
an email, but after 2nd, 3rd, 4th... and so on, no more email sent to me.

Can you post the code of both the .vbs and the .asp file?

 

by: daniel_cPosted on 2001-06-03 at 13:20:10ID: 6150869

This is a file that will be run under SSL:
TestEmail.asp
-------------
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<TITLE>Test Email</TITLE>
</HEAD>
<BODY>
<%
     strMessage = "Email Testing"

     ' -------------------- Send Email To Donor --------------------------------    
     RecipientName          =     "Robot"
     set objSession          =     CreateObject("CDONTS.Session")
     objSession.LogonSMTP     "myCompany Robot", "daniel_c@hotmail.com"    
     set objOutBox          =     objSession.Outbox
     set objMessage          =     objOutBox.Messages.Add
     objMessage.Subject     =     "Email " & RecipientName
     objMessage.Text          =     strMessage    
     objMessage.Recipients.Add  "myCompany", "daniel_c@hotmail.com", 1                              ' 1 = To, 2 = CC, 3 = BCC    
     objMessage.Recipients.Add  "Daniel Cahya", "daniel_c@lycos.com",  3      
     objMessage.Send    
     set     objMessage          =     Nothing
     set     objOutBox          =     Nothing    
     objSession.Logoff      
     set objSession          =     Nothing    
%>
Email has been sent.
</BODY>
</HTML>


And this is the file that using ASPTear to run TestEmail.asp:
Test.ASP
-------
<%
     On Error resume Next
     sURL = "https://www.americanbible.org/opp21/lbs/testEmail.asp"
     
     set xObj  = Server.CreateObject("SOFTWING.ASPtear")
     strResult = xObj.Retrieve(sURL, 1, "", "", "") ' 1 - Post
     
     Dim objFSO
     Set objFSO = Server.CreateObject("Scripting.FileSystemObject")

     Set ts = ObjFSO.OpenTextFile("E:\Pub\test.log", 8)     ' 8 - For Appending
     if Err.number = 0 then
          ts.writeline(Now & " - Process completed successfully - Message: " & strResult)
     else
          ts.writeline(Now & " - Error in processing page - Message: [" & Err.number & "] - " &  Err.Description)
     end if
         
     ts.Close
     set     ts        = nothing
     Set objFSO = nothing

     
     set xObj  = nothing
%>



 

by: daniel_cPosted on 2001-06-04 at 10:31:11ID: 6153451

Robbert, the problem was caused by the behavior of the ASPTear component which is always caching the page.
So, to avoid that, you have to put different query string (dummy parameter).
I've done the modification, and it worked well, but another problem raises now (Murphy's Law ^_^), after I changed the code become VBS, it seems that it doesn't work at all.

Is there anything wrong with my VBS?
Here is my VBS:

     function DummyParam
          dim sDay, sMonth, sYear, sHour, sMin, sSec
                   
          sDay          = Day(Now)
          if len(sDay) = 1 then
               sDay = "0" & sDay
          end if
         
          sMonth          = Month(Now)
          if len(sMonth) = 1 then
               sMonth = "0" & sMonth
          end if
         
          sYear          = Year(Now)
          if len(sYear) = 1 then
               sYear = "0" & sYear
          end if
         
          sHour          = Hour(Now)
          if len(sHour) = 1 then
               sHour = "0" & sHour
          end if
         
          sMin          = Minute(Now)
          if len(sMin) = 1 then
               sMin = "0" & sMin
          end if
         
          sSec          = Second(Now)
          if len(sSec) = 1 then
               sSec = "0" & sSec
          end if
         
          DummyParam = sDay & sMonth & sYear & sHour & sMin & sSec
     end function


     On Error resume Next
     sURL = "https://www.americanbible.org/opp21/lbs/testEmail.asp?now=" & DummyParam
     
     set xObj  = Server.CreateObject("SOFTWING.ASPtear")
     strResult = xObj.Retrieve(sURL, 1, "", "", "") ' 1 - Post
     
     Dim objFSO
     Set objFSO = Server.CreateObject("Scripting.FileSystemObject")

     Set ts = ObjFSO.OpenTextFile("E:\Pub\ScriptResult.Txt", 8, true)     ' 8 - For Appending
     if Err.number = 0 then
          ts.writeline(Now & " - Process completed successfully - Message: " & strResult)
     else
          ts.writeline(Now & " - Error in processing page - Message: [" & Err.number & "] - " &  Err.Description)
     end if
         
     ts.Close
     set     ts        = nothing
     Set objFSO = nothing

     
     set xObj  = nothing


 

by: Silvers5Posted on 2001-06-05 at 01:14:50ID: 6155409

SSL? what exactly this page should do? are you using CyberCash includes in the script? then you can also try this method out, it uses the MSXML objects which are installed with Windows 2000 (get them here:  http://download.microsoft.com/download/xml/Install/3.0/WIN98Me/EN-US/msxml3.exe for other operating systems) :
 
<%
    url = "https://www.mysite.com/xFiles.asp"
    set xmlhttp = server.CreateObject("Microsoft.XMLHTTP")
    xmlhttp.open "GET", url, false
    xmlhttp.send ""
    'Response.write xmlhttp.responseText 'optional here..
%>

 

by: daniel_cPosted on 2001-06-05 at 05:12:29ID: 6155832

Silver 5:
Hmmm... too bad, my webserver is still using NT 4.0

But anyway, I have figured it out by using ASPTear component as Robbert suggested.
The problem now is my VBS, it seems that it doesn't work when I put it on Task Scheduler.

Is anything wrong with my VBS above Silver5?
Could you please tell me if I do wrong?

Thanks in advance,

Daniel

 

by: Silvers5Posted on 2001-06-05 at 06:04:09ID: 6156020

I provided you with the link to download for NT4..

about the code.. comment the On Error resume next line and post here the error description..
rgrds

 

by: daniel_cPosted on 2001-06-05 at 06:57:21ID: 6156216

Silver5, thanks for remind me of commenting "On Error Resume Next".

I got the error already.

I'll give you other point in the ASP forum, since Robbert has also given solution to my problem.

Thanks for your help guys, you are really EXPERT!!!

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...