title: how can I copy and delete only the files base of modified date in vbscript?
body: <p>all files from my source file location has been copied in 
  destination folder. 
  how can i copy then delete the 2 files only if my 
  datefrom = 12/07/2014 and my 
  dateto = 12/09/2014.</p>
  
  <ul>
  <li>filename:  date modified </li>
  <li>file1       12/07/2014   </li>
  <li>file2       12/09/2014</li>
  <li>file3       01/06/2015</li>
  </ul>
  
  <p>this is my code.</p>
  
  <pre><code>    Dim ObjFso 
      Set objFSO = CreateObject("Scripting.FileSystemObject")
      Dim StrSourceLocation
      Dim StrDestinationLocation
      Dim StrSourceFileName  
      dim SourceLocation
      dim DestinationLocation
      dim datefrom, dateto, datectr
      datefrom = DateValue("01/01/2015")
      dateto = DateValue("01/01/2015")
  
      datefrom = InputBox ("date from: (mm/dd/yyyy)")
      dateto = InputBox ("date to: (mm/dd/yyyy)")
      StrSourceLocation = InputBox ("source:")
      StrDestinationLocation = InputBox ("destination:")
  
      datectr = datefrom
      dateto = dateto
      intYear=0
      intMonth=0
      indDay=0
      intFileCtr=0
      intFileDayCtr=0
  
  
      SourceLocation = StrSourceLocation + "\*.*"
      DestinationLocation = StrDestinationLocation + "\"
  
      Const OverwriteExisting = True
  
      Do Until datectr&gt;dateto
  
      intYear=Year(datectr)
      intMonth=Month(datectr)
      intDay=Day(datectr)
  
  
      for each f in objFSO.Getfolder(StrSourceLocation).Files
  
      if Year(f.DateLastModified) = intYear And Month(f.DatelastModified) = intMonth And Day(f.DateLastModified) = intDay Then
  
      objFSO.CopyFile SourceLocation , DestinationLocation, OverwriteExisting
      objFSO.DeleteFile(SourceLocation), True
  
      end if
      Next
  
  datectr=DateAdd("d", 1, datectr)
  datectr = DateValue(datectr)
  
  Loop
  </code></pre>