Set Fso = CreateObject("Scripting.FileSystemObject")
ListFolderContents("E:\Backup\Folder1\Folder2")
Sub ListFolderContents(path)
Set fs = CreateObject("Scripting.FileSystemObject")
Set folder = fs.GetFolder(path)
For each item in folder.SubFolders
DeleteFiles(item.Path)
Next
Set folder = Nothing
set fs = Nothing
End Sub
Sub DeleteFiles(Dir)
Set Directory = Fso.GetFolder(Dir)
Set Files = Directory.Files
For Each Modified In Files
If DateDiff("D", Modified.DateLastModified, Now) > 1 Then Modified.Delete
Next
End Sub
[/code]
To mi neradi.Zasto? Kako da drugcije to istestiram? Imali ko mozda kakvo jednostavnije rjesenje? More i bat fajl.