Batch process to delete folers and bypass recycle bin on WinNT
Posted on 2005-04-23
I have a batch file to delete folders on a WindowsNT Server shown at the end of this question. My problem is that the folders I'm deleting are 26GB. Is there any way to bypass the recycle bin while deleting?
Here's the function I'm using right now:
Private Function fDeleteFolders(BackupPath,TSO)
Set FSO = CreateObject("Scripting.FileSystemObject")
Set Folders = FSO.GetFolder(BackupPath)
For Each Folder In Folders.subFolders
If DateDiff("d", Folder.DateCreated, Date) < 10 Then
TSO.Write "Deleted: " & Folder.Name & vbCrLf
fDeleteFolders = "true"
Set Folder = Nothing
Set Folders = Nothing