Adding tasks to Windows scheduler with PHP

旧街凉风 提交于 2019-12-12 17:37:50

问题


I'm unable to find any information on adding tasks to Windows Task Scheduler with PHP. I can use exec().

This has to work on IIS.


回答1:


Windows Schedule Task has a command line utility called Schtasks you can use this utility to add your task to Scheduled task list.

Please go thru the URL for syntax of Schtasks http://technet.microsoft.com/en-us/library/cc772785%28WS.10%29.aspx#BKMK_run




回答2:


Syntax for schtasks

Schtasks /create /sc ScheduleType /tn TaskName /tr TaskRun [/s Computer [/u [Domain\]User [/p Password]]] [/ru {[Domain\]User | System}] [/rp Password] [/mo Modifier] [/d Day[,Day...] | *] [/m Month[,Month...]] [/i IdleTime] [/st StartTime] [/ri Interval] [{/et EndTime | /du Duration} [/k]] [/sd StartDate] [/ed EndDate] [/it] [/Z] [/F]

You can use

$cmd = 'schtasks /create blah blah blah...';
exec ($cmd);


来源:https://stackoverflow.com/questions/1913291/adding-tasks-to-windows-scheduler-with-php

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!