title: Comparing creation dates of files in VBScript
body: <p>This may be very obvious to someone out there but I'm having a lot of trouble trying to solve a bug in VBScript. Within the script, I am running through a bunch of .zip files in a directory and processing ones whose creation date is within a specified range.</p>
  
  <p>For instance, if the user enters two arguments 9/3/2014 and 9/5/2014, I only want to process zip files within that date range.</p>
  
  <p>Here is the if statement I am using:</p>
  
  <pre><code> If Mid(file.NAME,len(file.NAME)-3,4) = ".zip" AND 
   FormatDateTime(file.DateCreated, 2) &gt;= Wscript.Arguments(1) AND 
   FormatDateTime(file.DateCreated, 2) &lt;= Wscript.Arguments(2) then
  </code></pre>
  
  <p>I am using the FormatDateTime function to remove the times from the file creation date. That way I should just be left with a short date (mm/dd/yyyy). </p>
  
  <p>The problem I am having is that I am processing dates outside of the given range. For example if the given range is 9/3/2014 to 9/5/2014 then I also end up processing 9/30/2014 for some reason. Can anyone help solve this?</p>