At a certain time, I want to run a ASP file to execute a task, such as a factory to collect all the meter readings at 9 o'clock in the morning, and of course it is to connect to each electric meter through in SQL. We now use A ASP file focuses the readings of the IN SQL to MS SQL.
There are many ways to run the ASP file in the timing you see, but I am now talking about a simple way, using a planned task to make a simple implementation.
First, you have to write a JS or VBS file to call all your executed ASP. Below is the code of the JS and VBS files, you can choose one, the execution effect is the same.
VBS code ------------------------- 'Code by Xiaohi Aston314@sohu.com'create an instance of Iedim IESET IE = CreateObject ("InternetExplorer .Application ")
'Run your URL
IE.NAVIGATE ("http://www.blueidea.com/") ie.visible = 1
'Clean Up ... set i = nothing ---------------------------------
You can take any name, but if you must be VBS, here we name Do.vbs.
JS code --------------------------- // Code by Xiaohe Aston314@sohu.com/ Create the Html Message to Display.var HTML = ""; html = "
// Create Internet Explorer Objectie = New ActiveXObject ("InternetExplorer.Application);
// define how the window shopie.LEFT = 50; IE.TOP = 50; IE.HEIGHT = 510; IE.Width = 470; IE.Menubar = 0; IE.Toolbar = 0;
// set the browser to a blank pageie.navigate ("http://www.blueidea.com/");
// Show the browserie.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 if you must be JS, here we name DO.JS.
There is no explanation of the code in the file here.
Just put all the http://www.blueidea.com in the above file to replace the URL address of the ASP file you want to perform. Here is the URL address, not an absolute address.
Then open the Windows task plan, select the location of the Do.js or the DO.vbs file like any executable, set the execution time, etc., and then determine it. Then this ASP file can be run by the task plan, simple.
Just as the beginning, the task plan can execute this ASP file at 9 o'clock in the morning, collect the reading of the meter into MS SQL.