Great code.. so great and I am trying to use it! How would I run this against multiple locations (servers) without having to create a completely different job?
Right now my "totally stolen" code looks like this:
Sorry to bother you.. but I am trying to use some code you posted long ago in 2008. It worked great but I am trying to remove files from 2 different locations (servers). I was hoping you can help me..
Right now my code looks like this..
on error resume next
'Customize values to clear Reports
'Question is here.. how do I loop around to grab a second location?
iDaysOld = 90
Set oFSO = CreateObject("Scripting.FileSystemObject")
sDirectoryPath = "\\LIBERTY\Tailsheets"
set oFolder = oFSO.GetFolder(sDirectoryPath)
set oFileCollection = oFolder.Files
'Walk through each file in this folder collection.
'If it is older than 3 months (90) days, then delete it.
For each oFile in oFileCollection
If oFile.DateLastModified < (Date() - iDaysOld) Then
Set oFSO = Nothing
Set oFolder = Nothing
Set oFileCollection = Nothing
Set oFile = Nothing