Plesk Windows Scheduler to call an ASP or ASP.NET

1. Click on 'Scheduled Tasks' in Plesk

2. 'Add New Task'

3. Enter a Description and Email if required

4. In the 'Path to executable file' field ENTER the path: C:\Windows\system32\cscript.exe

5. In the 'Arguments' field Enter: C:\inetpub\vhosts\MyDomain.com\httpdocs\myschedule.vbs 

6. Because cscript.exe won't execute an asp file, you have to create a vbs script, that will then call the asp script.
In the myschedule.vbs script, we'll use the xmlhttp request to open a web page.
Copy and paste the script below and save to a file called myschedule.vbs and upload this to your site.

-------------------------------------
Call RunIt()
Sub RunIt()

Dim RequestObj
Dim URL
Set RequestObj = CreateObject("Microsoft.XMLHTTP")

'Request URL...
URL = "http://www.Domain.com/yourScript.aspx"

'Open request and pass the URL
RequestObj.open "POST", URL , false

'Send Request
RequestObj.Send

'cleanup
Set RequestObj = Nothing
End Sub
-----------------------------------

7. Now you can create your scriptSchedule.aspx page, or whatever you would like to name it to perform the tasks you require to be scheduled.

  • 0 Utilizadores acharam útil
Esta resposta foi útil?

Artigos Relacionados

Sending email using CDOSYS

If you are using a Windows 2000 / 2003 Server, or even XP Pro chances are that CDOSYS is your...

Upload file through ASP.net

<% @Page Language="C#" %><html><head>  <title>File upload...

Mailenable Component - Mail Code

Mailenable Component - Mail Code <%@ Language=VBScript %> <% Dim oMail Set oMail =...

How to create MSAccess Database DSN in Plesk Control Panel?

To Create DSN for MSAccess Database do following steps. 1. Access your control panel 2. Click on...

Create MS Access DSNLess connection string

Many people have requested this so here it is: "DRIVER={Microsoft Access Driver (*.mdb)};...