On a Windows server, we have a task which runs occasionally, using "Scheduled Tasks" to control it. (best not to run it directly, since it might need to be run as a particular user, and the Scheduled Task configuration has all the appropriate passwords).
We'd like to control this via a PHP script, so that visitors to a website can request the task be run. Can PHP trigger the scheduled task? Including giving an error or taking no action if the task is already running.
Note: lockfiles etc. probably not a useful solution, since the task could fail/crash before completing