title: VB Script to move files around based on date changed
body: <p>I am looking to write a VB script to keep a folder tidy up. The rules are:</p>
  
  <ul>
  <li>Check if any file was changed today</li>
  <li>If at least one file was changed today move all the files last changed 2 days ago to another folder</li>
  </ul>
  
  <p>This is what I have so far:</p>
  
  <pre><code>strFolder = "c:\testdelete"
  objFSO = CreateObject("Scripting.FileSystemObject")
  Set objFolder = objFSO.GetFolder(strFolder)
  Set colFiles = objFolder.Files
  For Each objFile In colFiles
    If DateDiff("N",objFile.DateLastModified,Now()) &gt; 4320 Then
      objFSO.DeleteFile(objFile),True  End if  Next
  </code></pre>
  
  <p>This however is not working.</p>