title: Windows Batch File Time Comparison
body: <p>I am trying to compare current system time to a set time. Please see below:</p>
  
  <pre><code> set currentTime=%TIME%
   set flag=false
  
   if %currentTime% geq 07:00 if %currentTime% leq 22:45 set flag=true
  
   if %flag%==true (
  
  
   ) else (
  
   )
  </code></pre>
  
  <p>If the time is between 7 am and 10:45pm then perform this action otherwise perform the other.</p>
  
  <p>The problem is this doesn't work.  The results constantly vary. I think it has to do with my comparison to i.e., 07:00</p>