title: Executing PHP file with Windows server 2008 Scheduled Task
body: <p>i know there are a lot of posts about scheduled task and a fair few about executing PHP files but i have looked and tried to figure it out but still coming up short.</p>
  
  <p>I am still learning a lot of the ways of Windows server so please, if something needs to be pointed out let me know.</p>
  
  <p>So i set up a scheduled task that would execute at 1am and in all fairness this worked a charm, however i didn't realise that it would just open the file in notepad (Because that is the application that php files are associated with).</p>
  
  <p>So i did my research and found a lot people saying that i needed to pass the php.exe file in with it, these people were also providing i add this to the task:</p>
  
  <pre><code>C:\Path\to\php.exe -f "C:\Path\to\file.php"
  </code></pre>
  
  <p>So i put it in the action tab like so. please note that there is an error in the screen shot, i forgot to put \php.exe at the end of the sting.
  <img src="https://i.stack.imgur.com/B1rJ7.png" alt="Screen shot of New task widnow"></p>
  
  <p>When i click OK i get asked this</p>
  
  <p><img src="https://i.stack.imgur.com/SuzwJ.png" alt="Screen shot after clicking OK"></p>
  
  <p>As you can see from the picture it only lists "C:\Program"</p>
  
  <p>I've tried moving things around and had nothing, i've tried wrapping the first part in quotes as well. </p>
  
  <p>So can someone tell me what i need to do or what i'm doing wrong here? </p>
  
  <p>Thanks for your time.</p>