See www.cpearson.com/excel/Recycle.htm for information and
example code about using the SHFileOperation API call to delete a
file or folder to the recycle bin.
Function DeleteFolder(sFolder As String) As Boolean
'// Dana DeLouis
'// = = = = = = = = = =
'// Folder can have Wildcard Characters
'// True if folders with the read-only attribute set are to be deleted
'// = = = = = = = = = =
On Error Resume Next
With CreateObject("Scripting.FileSystemObject")
.DeleteFolder sFolder, True
DeleteFolder = Err.Number = 0
End With
End Function
Sub TestIt()
Dim Status As Boolean
Status = DeleteFolder("D:\Junk")
' Delete all Temp* Folders
Status = DeleteFolder("D:\Temp*")
End Sub