scheduling execution of a VBScript using WSH

Results 1 to 2 of 2

Thread: scheduling execution of a VBScript using WSH

  1. #1
    Join Date
    Dec 1969

    Default scheduling execution of a VBScript using WSH

    I have an ASP page that gathers information form another site using ASPTear and writes the information to a text file using FSO. I would like to use WSH to execute this type of maintenance once per day. I know I could use the AT command to open IE and execute the ASP, but that doesn&#039t seem very elegant.... executing the WSH script seems like a better solution, but I am running into a few problems.... Here is a similar script:<BR><BR>1 Const Request_POST = 1<BR>2 Const Request_GET = 2<BR>3 Const fsoForWriting = 2<BR>4 <BR>5 Dim buffer<BR>6 Dim output<BR>7 <BR>8 Set xobj = CreateObject("SOFTWING.AspTear")<BR>9 Response.ContentType = "text/html"<BR>10 <BR>11 On Error Resume Next<BR>12 Dim strRetval<BR>13 strRetval = xobj.Retrieve("", Request_Get, "", "", "")<BR>14 output = strRetval<BR>15<BR>16 xobj.Close<BR>17 Set xobj = Nothing<BR>18 <BR>19 Dim objFSO<BR>20 Set objFSO = Server.CreateObject("Scripting.FileSystemObject")< BR>21<BR>22 &#039Open the text file<BR>23 Dim objTextStream<BR>24 Set objTextStream = objFSO.OpenTextFile("D:MyTextFile.txt", fsoForWriting, True)<BR>25 <BR>26 objTextStream.WriteLine output<BR>27<BR>28 &#039Close the file and clean up<BR>29 objTextStream.Close<BR>30 Set objTextStream = Nothing<BR>31 Set objFSO = Nothing<BR><BR>Here are my errors:<BR>Line 9 generates a "Object Required: &#039Response&#039" error<BR>As I understand it, this is because WSH will not allow input/output from IIS<BR><BR>If I comment line 9 out, I get no result from the execution of the script.<BR><BR>I tried using Microsoft Internet Transfer Control instead of ASPTear but the following line generates an "Object Required: &#039Server&#039" Error:<BR><BR>Set inet = Server.CreateObject("InetCtls.Inet")<BR><BR><BR><B R>Does anyone have any ideas or suggestions.... any help would be most appreciated.<BR><BR>Thanks,<BR>Russell<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: scheduling execution of a VBScript using WSH

    Sorry - not a solution but I&#039ve gotten WSH questions answered here before:<BR><BR><BR>Good luck

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts