Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
'==========================================================================
'
' NAME: CleanBadMail.vbs
'
' AUTHOR: Mark D. MacLachlan , The Spider's Parlor
' URL : [URL unfurl="true"]http://www.thespidersparlor.com[/URL]
' COPYRIGHT (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.
'
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
' ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED To
' THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
' PARTICULAR PURPOSE.
'
' IN NO EVENT SHALL THE SPIDER'S PARLOR AND/OR ITS RESPECTIVE SUPPLIERS
' BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
' DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
' WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
' ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
' OF THIS CODE OR INFORMATION.
'=====================================
Path1 = "E:\Program Files\Exchsrvr\Mailroot\vsi 1\BadMail"
Path2 = "E:\Program Files\Exchsrvr\Mailroot\vsi 1\UceArchive"
'This third path is not used unless you modify the script below
Path3 = "E:\Program Files\Quarantine"
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 = fso.GetFolder(Path2)
For Each oFile In oFolder.files
If DateDiff("d", oFile.DateCreated,Now) > 30 Then
oFile.Delete True
End If
Next
Set oFolder = Nothing
'The script will stop running here.
'Remove the next line if you need to delete subdirectories from a given path.
Wscript.Quit
'If you need to delete sub folders instead of files from a directory, the below code will do that for you.
Set oFolder = fso.GetFolder(Path3)
Set colSubfolders = oFolder.Subfolders
For Each oSubfolder in colSubfolders
If DateDiff("d", oSubFolder.DateCreated,Now) > 30 Then
fso.DeleteFolder(oSubFolder)
End If
Next
Set oSubFolder = Nothing
Set oFolder = Nothing
Set fso = Nothing