Scheduling an asp.net app running on iis/Win2k

J

JIK

Hi.

I want to schedule an asp.net app running on a win2k server/iis.

The asp.net app is installed and works fine in the browser. It also works
fine from ab vb script when I run it from the prompt/explorer:

Kommant from prompt:
runasp.vbs http://localhost/theapp.aspx

The script (runasp.vbs):
Option Explicit

On Error Resume Next'

' Script som kjører kall mot iis server for å kjøre kode fra schedule

' Declare our vars

Dim objWinHttp, strURL

' Request URL from 1st Command Line Argument. This is

' a nice option so you can use the same file to

' schedule any number of differnet scripts just by

' changing the command line parameter.

strURL = WScript.Arguments(0)

' Could also hard code if you want:

'strURL = "http://localhost/ScheduleMe.asp"

' For more WinHTTP v5.0 info, including where to get

' the component, see our HTTP sample:

' http://www.asp101.com/samples/winhttp5.asp

Set objWinHttp = CreateObject("WinHttp.WinHttpRequest.5")

objWinHttp.Open "GET", strURL

objWinHttp.Send

' Get the Status and compare it to the expected 200

' which is the code for a successful HTTP request:

' http://www.asp101.com/resources/httpcodes.asp

If objWinHttp.Status <> 200 Then

' If it's not 200 we throw an error... we'll

' check for it and others later.

Err.Raise 1, "HttpRequester", "Invalid HTTP Response Code"

End If



But when I try to start this from the win scheduler it wont run....



Anybody have any suggestions?





Jon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top