title: VBScript to delete files that are 100kb or smaller
body: <pre><code>iDaysOld = 0
  Set oFSO = CreateObject("Scripting.FileSystemObject")
  sDirectoryPath = "C:\Nouve\"
  set oFolder = oFSO.GetFolder(sDirectoryPath)
  set oFileCollection = oFolder.Files
  'If database log file backups are older than "iDaysOld" days, delete them.
  For each oFile in oFileCollection
        If oFile.Size &lt; 400000 Then 
              oFile.Delete(True)
        End If
  Next
  
  
  'Clean up
  Set oFSO = Nothing
  Set oFolder = Nothing
  Set oFileCollection = Nothing
  Set oFile = Nothing
  
  Sub RecurseFolders(oFolder)
        set oFileCollection = oFolder.Files
        'If database log file backups are older than "iDaysOld" days, delete them.
        For each oFile in oFileCollection
              If oFile.Size &lt; 100000 Then 
                    oFile.Delete(True)
              End If
        Next      
        End Sub
  
  Ret=Msgbox("Small Calls Deletion Completed Successfully") 
  </code></pre>
  
  <p>I am looking for a script that will delete only exe file in a folder and it's sub-folders that are 400kb or smaller.</p>
  
  <p>Thanks in advance for any assistance with this script.</p>