views:

105

answers:

2

I am getting error in scheduled task :"http://localhost:4625/DataUpdater.aspx.Error Message:Object reference not set to an instance of an object."

Scheduledtask vbs script :

Call LogEntry()

Sub LogEntry()

    On Error Resume Next     

    Dim objRequest
    Dim URL

    Set objRequest = CreateObject("Microsoft.XMLHTTP")

    URL = "http://localhost:4625/DataUpdater.aspx"

    objRequest.open "POST", URL , false

    objRequest.Send

    Set objRequest = Nothing

End Sub
A: 

If the error is coming back from Cassini/IIS then you should post the code in the .aspx / .aspx.cs file, and the line the error is occurring on.

John Weldon
When i run it manually,it works.The issue is only with scheduled task.
Jignesh
Is the error in the website or the vbscript? Often scheduled task issues are related to permissions and which account the task is running under.
John Weldon
The VBScript is ok.The error is in the dataupdater page.I have used Session state in Page_Load().
Jignesh
A: 

Have you tried to use a batch file to do this?

For example here are some sample run lines:

cscript.exe c:\scripts\call_logs.vbs

Or:

script.exe c:\scripts\call_logs.vbs

Here is one that I use to archive off IIS Logs:

C:\WINDOWS\system32\wscript.exe D:\scripts\list.vbs

HTH,

Kent

Leptonator