How to run scheduled tasks on windows hosting.? For example, with the Plesk control panel.
At the first look, everything is ok. We have scheduled task and “command line” for it. But what should I write there? This is a big question.
Somebody says – no problem, I’ll write “iexplore http://example.com/track.aspx”
But I’m wondering, how will internet explorer process on server will be terminated, and what if you are going to run this task each 15 minutes?
I don’t like this way. So, where is the answer? Answer is VB script. All what we need – is to create vb script and run it inside command string.
This script creates Microsoft.XMLHTTP instance (yes, we don’t need to check anything like with AJAX deal, because we are certainly in Microsoft environment). And using this instance request your ASPX page to do all the job.
So, when I’ve asked my hosting support, how to call aspx page scheduled – they said – this is impossible. Call PHP page and curl your ASPX if you want. No, thanks.
Plesk screen… to add scheduled task. “Path to executable” should be set to ABSOLUTE path to vbs file on server. Where you can get this path… First of all, you hoster should give you info about your site’s folder. If not, write a simple aspx page with Server.MapPath(“my.vbs”);
Here is sample vb file.
