title: Run PHP script with Windows Task Scheduler, including files fails
body: <p>I'm given a Windows 2012R2 machine with XAMPP. I need to schedule a task that runs every minute. Every minute a PHP script should be executed. This is configured correctly, I'm using a .BAT file as action in Task Scheduler.</p>
  
  <p>The problem is that when I test the .BAT file, it works like a charm (execute the .BAT file from the folder it's in). But when Task Scheduler executes the .BAT file it fails. The script is then unable to include some files that the PHP script calls. I'm guessing that's because Task Scheduler doesn't execute the script from the directory the PHP script is in. CronjobBase.php has a line that includes <code>MyIncludes.php</code> (examplary, in real life a bootstrap file is included)</p>
  
  <p>This is my .BAT content (there's no difference in using or leaving the quotes with the CD command):</p>
  
  <pre><code>cd "D:\xampp\htdocs\MyApp\App\Cronjobs\"
  "D:\xampp\php\php.exe" -f CronjobBase.php MyCronJob
  </code></pre>
  
  <p>I'm trying to CD into the Cronjobs folder to execute CronjobBase.php with <code>argv[1]</code> as MyCronJob (which should include MyCronJob.php from CronjobBase.php). It tells me CronjobBase.php is not found. I'm guessing CD-ing into the Cronjobs folder fails.</p>
  
  <p>When I try <code>"D:\xampp\php\php.exe" -f D:\xampp\htdocs\MyApp\App\Cronjobs\CronjobBase.php MyCronJob</code> as .BAT content the inclusion of 'MyIncludes.php` fails and the script terminates.</p>
  
  <p>Any suggestions on what I'm doing wrong?</p>