title: Use Task Scheduler to run a ASP file?
body: <p>Hi there I wish to run the following code every day at 9 am. Basically, the code will read a txt file and from each line. It will process and insert into a Mysql table. How do I accomplish this? I have found the following <a href="https://stackoverflow.com/questions/10383165/make-server-automatic-run-asp-script-every-day">Make server automatic run asp-script every day</a> but it is not working. Please help.</p>
  
  <pre><code>  &lt;%
      strFileName = "database/testdata.txt"                                        
  
      Set fso = Server.CreateObject("Scripting.FileSystemObject") 
      set fs = fso.OpenTextFile(Server.MapPath(strFileName), 1, true) 
      if not fs.AtEndOfStream then
          Do while not fs.AtEndOfStream 
              strRow = fs.ReadLine
              sDate = Mid(Trim(strRow), 1, 8)
  
              Set rstTMClk1 = server.CreateObject("ADODB.RecordSet")    '=== Transfer from file to TMCLK1
              sSQL = "select * from TMCLK1 '" 
              rstTMClk1.Open sSQL, conn, 3, 3
              if rstTMClk1.eof then '=== To avoid duplicates
                  sSQL = "insert into TMCLK1 (DT_WORK) "
                  sSQL = sSQL &amp; "values ("
                  sSQL = sSQL &amp; "'" &amp; fdate2(sDate) &amp; "'"     
                  sSQL = sSQL &amp; ") "
                  conn.execute sSQL
              end if
              pCloseTables(rstTMClk1)
          Loop
      end if
      pCloseTables(fs)
  %&gt;
  </code></pre>