I'm using this script:
Set objFileSys = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFileSys.GetFolder("C:\DVR_Media\video")
For Each Folder In objFolder.SubFolders
FolderCreated = Folder.DateCreated
FolderAge = DateDiff("d", FolderCreated, Now)
If FolderAge >= 0 Then
get_ShowSubFolders(folder)
End If
Next
Sub get_ShowSubFolders(Folder)
For Each subfolder In Folder.Subfolders
if subfolder.name = "camera 04" then
subfolder.delete
end if
Next
End Sub
Right now the script will delete "camera 04" folder
I would like to modify this script to keep "camera 04" folder and delete all files inside this folder except the files that were created less than 30 minutes old
But i'm a newbie and i don't know how to do this... Could someone help me?
Thanks a lot!
Set objFileSys = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFileSys.GetFolder("C:\DVR_Media\video")
For Each Folder In objFolder.SubFolders
FolderCreated = Folder.DateCreated
FolderAge = DateDiff("d", FolderCreated, Now)
If FolderAge >= 0 Then
get_ShowSubFolders(folder)
End If
Next
Sub get_ShowSubFolders(Folder)
For Each subfolder In Folder.Subfolders
if subfolder.name = "camera 04" then
subfolder.delete
end if
Next
End Sub
Right now the script will delete "camera 04" folder
I would like to modify this script to keep "camera 04" folder and delete all files inside this folder except the files that were created less than 30 minutes old
But i'm a newbie and i don't know how to do this... Could someone help me?
Thanks a lot!