title: Running SCHTASK command in batch file with apache/php setup (windows)
body: <p>I have multiple batch files containing lines like</p>
  
  <pre>"schtasks.exe /create /tn NAME /tr \"cmd.exe /C \\\"start iexplore\\\"\" /sc once /st 03:05:43 /sd 12/18/2011"</pre>
  
  <p>and I would like to have my PHP file execute the batch file and thus schedule the multiple task..</p>
  
  <pre>exec("C:\\Wamp\\www\\batch\\$this->name.bat")</pre> 
  
  <p>doesn't work and neither does</p>
  
  <pre>exec("cmd /K \"C:\\Wamp\\www\\batch\\123.bat\"")</pre>
  
  <p>works</p>
  
  <p>The commands in the batch is inserted to the cmd but not executed.</p>
  
  <p>But this is not the major problem..</p>
  
  <p>When i try to simply </p>
  
  <pre>shell_exec("schtasks /create /tn NAME /tr \"cmd.exe /C \\\"start iexplore\\\"\" /sc once /st 03:05:43 /sd 12/21/2011");</pre>
  
  <p>in the apache log, it has</p>
  
  <p>"ERROR: No mapping between account names and security IDs was done."</p>
  
  <p>From other threads I figure this is permission problem, but I have no idea how to solve this.</p>
  
  <p>EDIT: I am sure the schtask command is working fine.  I echo the command, put it in the command prompt on the machine manually, and it works fine</p>