Deleta uma pasta.
O DirName pode ser um caminho absoluto ou relativo.
Sub DeleteFolder(ByVal DirName)
On Error Resume Next
If Mid(DirName, 2, 1) <> ":" Then
DirName = Server.MapPath(DirName)
End If
If Err Then Err.Clear
On Error GoTo 0
Dim FSO
Set FSO = Server.CreateObject("Scripting.FileSystemObject")
On Error Resume Next
If FSO.FolderExists(DirName) Then
FSO.DeleteFolder DirName
End If
On Error GoTo 0
Set FSO = Nothing
End Sub
Nenhum comentário:
Postar um comentário