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
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