Remove Directory using API:   Return to List

Private Declare Function RemoveDirectory Lib "kernel32.dll" Alias _
    "RemoveDirectoryA" (ByVal lpPathName As String) As Long

Private Sub Form_Load()
    retval = RemoveDirectory("C:\Temp")
    If retval = 1 Then
        MsgBox "C:\Temp was successfully deleted."
    Else
        MsgBox "Deletion failed."
    End If
End Sub



Note to Webmaster