How to run ASP file _asp base accurately and regularly

Source: Internet
Author: User
Tags blank page

In a certain time, to run a regular ASP file to perform a task, such as a factory at 9 o'clock in the morning to collect all the meter readings, of course, through in-SQL connection to the various meters, we are now using an ASP file to the table in the SQL of the reading again to focus on MS SQL.

There are a number of ways you can see the timing of running ASP files, but what I'm going to say now is an easy way to make use of a scheduled task to do it easily.

First, you have to write a JS or VBS file to invoke all of your executed ASP. Here are the JS and VBS file code, you can choose one, the execution effect is the same.

VBS CODE-------------------------
' CODE by Little Lotus aston314@sohu.com
' Create an instance of IE
Dim IE
Set IE = CreateObject ("Internetexplorer.application")

' Run your URL

Ie.navigate ("http://www.knowsky.com/")
Ie.visible=1

' Clean up ...
Set IE = Nothing
---------------------------------

You can take any name, but the suffix name must be VBS, where we name Do.vbs.

JS Code---------------------------
var html = "";
html = "HTML + + "<font face=verdana></font>";
HTML + "</body>


Create Internet Explorer Object
ie = new ActiveXObject ("Internetexplorer.application");

Define How the window should look
Ie.left = 50;
Ie.top = 50;
Ie.height = 510;
Ie.width = 470;
Ie.menubar = 0;
Ie.toolbar = 0;

Set the browser to a blank page
Ie.navigate ("http://www.knowsky.com/");

Show the browser
ie.visible=1;

Open a stream and write data.
Ie.document.open;
Ie.document.write (HTML);
Ie.document.close;
------------------------------------

You can also take any name, but the suffix name must be JS, where we name Do.js.

The code in the file is not explained here.

Just replace all the http://www.knowsky.com/in the above file with the URL address of the ASP file you want to execute. Here is the URL address, not the absolute address.

Then open the task plan for WINDOWS, just like selecting any executable file, select the location of the above do.js or Do.vbs file, set the execution time, and so on, OK.

Then this ASP file can be scheduled to be scheduled to run the task, simple.

As the beginning says, the task plan can execute this ASP file at 9 in the morning and collect the meter readings into MS SQL.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.