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.