I’ve just finnished working on a project where I needed to schedule a PHP script to upload and then process a CSV file. For various reasons we weren’t able to create a cron job, so in the end we decided to set a scheduled task up on a Windows server that would then run a VBS script that would in turn call the PHP script on the other server.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Call LogEntry() Sub LogEntry() On Error Resume Next Dim requestObj Dim url Set requestObj = CreateObject("Microsoft.XMLHTTP") url = "http://www.mywebsite.com/page.php?mode=somevariable" 'create a url and querystring requestObj.open "POST", url , false 'add method and add url to request object requestObj.Send 'send the request Set requestObj = Nothing 'clear the request object End Sub
Change the url variable to the address of the script that you want to call and then save the file as a .vbs file which you can then run using the built in windows task scheduler.