I am trying to set up Scheduled Tasks through my PHP program. Below is the code I am using.
$time = (strlen($_POST['agenttime']) < 5)? '0'.$_POST['agenttime'] : $_POST['agenttime'];
$command = 'schtasks /create /tn AP_Search_Agent /tr "php -q '.$path.'admin\\run-agent.php" /sc DAILY /st '.$time.':00 /ru "System"';
$result = shell_exec($command);
When I run the command through the Command Prompt it works. Anyone know why it won't work through a PHP script?
Thanks