开发者

How to return windows scheduled task list with php

开发者 https://www.devze.com 2023-03-21 02:05 出处:网络
I need a what for PHP to return all of Windows\' (XP) Scheduled Tasks - is this possible?I\'m creating a scheduling script and the user needs to be able to view what time slots are 开发者_StackOverflo

I need a what for PHP to return all of Windows' (XP) Scheduled Tasks - is this possible? I'm creating a scheduling script and the user needs to be able to view what time slots are 开发者_StackOverflow中文版already occupied.


This looks promising http://codesnob.wordpress.com/2009/05/18/displaying-windows-task-scheduler-tasks-with-php/

Also, http://msdn.microsoft.com/en-us/library/aa383448%28VS.85%29.aspx

And finally, http://www.php.net/manual/en/class.com.php

EDIT

I just ran a test my self and this worked. 32-bit Windows, Zend Server

$com = new com("Schedule.Service");
$com->Connect();
$oFolder = $com->GetFolder("\\");
$oCollection = $oFolder->GetTasks(0);
print "Count: " . $oCollection->Count . "n";
for ($i = 1; $i <= $oCollection->Count; $i++)
{
      echo $oCollection ->Item($i)->Name ;
}
0

精彩评论

暂无评论...
验证码 换一张
取 消