'===============================================
'
' VBScript Source File --
'
' NAME: CleanBadMail.vbs
'
' AUTHOR: Mark D. MacLachlan , The Spider's Parlor
' URL : [URL unfurl="true"]http://www.thespidersparlor.com[/URL]
' Copywrite (c) 2003 All rights reserved
' DATE : 09/10/2003
'
' COMMENT:
'
' This script will list all filtered and quarantined SPAM mail, check that
' the files are more than 30 days old and then delete them.
' This file is to be scheduled to run each day.
'=====================================
Path1 = "E:\Program Files\Exchsrvr\Mailroot\vsi 1\BadMail"
Dim fso
Dim oFolder
Dim oFile
Dim oSubFolder
Set fso = createobject("Scripting.FileSystemObject")
Set oFolder = fso.GetFolder(Path1)
For Each oFile In oFolder.files
If DateDiff("d", oFile.DateCreated,Now) > 30 Then
oFile.Delete True
End If
Next
Set oFolder = Nothing
Set fso = Nothing