Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.
Dim fso, startFolder, OlderThanDate Set fso = CreateObject("Scripting.FileSystemObject") startFolder = "\\sadvnfs01\Scan-DVN\" ' folder to start deleting (subfolders will also be cleaned) OlderThanDate = DateAdd("d", -7, Date) ' 7 days (adjust as necessary) DeleteOldFiles startFolder, OlderThanDate Function DeleteOldFiles(folderName, BeforeDate) Dim folder, file, fileCollection, folderCollection, subFolder Set folder = fso.GetFolder(folderName) Set fileCollection = folder.Files For Each file In fileCollection If file.DateLastModified < BeforeDate Then fso.DeleteFile(file.Path) End If Next Set folderCollection = folder.SubFolders For Each subFolder In folderCollection DeleteOldFiles subFolder.Path, BeforeDate Next End Function
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.