richardrekos
MIS
Does anyone know how to script the deletion of old files? I specifically want to delete files that contain "LPT$VPN" in the file name and are older than 3 days. Thanks in advance.
Rich
Rich
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.
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) > 3 Then
If Instr(1,oFile.Name,"LPT$VPN",1)
oFile.Delete True
End If
End If
Next