title: Every 5 min cron job between specific time (Windows server 2008 and batch file)
body: <p>Previous colleague set up cron job every 5 min for 24 hrs.<br />Now I need to modify this only running between 7am to 7pm.</p>
  
  <p>I had never learned cron job so I googled and tried but it didn't work.</p>
  
  <hr>
  
  <p>Task Scheduler is set as below</p>
  
  <p><img src="https://i.stack.imgur.com/rmFen.png" alt="enter image description here"></p>
  
  <p>And I modified the batch file from </p>
  
  <p>C:\PHP\php.exe -f C:\path\cron.php five-mins</p>
  
  <p>to</p>
  
  <p>7-19/5 * * * * C:\PHP\php.exe -f C:\path\cron.php five-mins</p>
  
  <hr>
  
  <p>Even I added 7-19/5 * * * * to batch file, it doesn't work.<br /><br />
  It would be appreciative if someone can help me. <br />
  Thanks in advance and thanks for taking your time.</p>
  
  <p><strong>update</strong><br /><br />
  I found this question on <a href="https://superuser.com/questions/133456/run-a-cron-job-every-5-minutes-between-two-times">https://superuser.com/questions/133456/run-a-cron-job-every-5-minutes-between-two-times</a> and changed the batch file */5 7-19 * * * instead of 7-19/5 * * * * however still not working.</p>
  
  <hr>
  
  <p><strong>solved</strong></p>
  
  <p>Got a good solution from RedGrittyBrick on superuser.com
  <a href="https://superuser.com/questions/926549/every-5-min-cron-job-between-specific-time-windows-server-2008-and-batch-file">https://superuser.com/questions/926549/every-5-min-cron-job-between-specific-time-windows-server-2008-and-batch-file</a></p>