Sub SupprimerDossier(ByVal PathOfDirectory As String)
If My.Computer.FileSystem.DirectoryExists(PathOfDirectory) = True Then
My.Computer.FileSystem.DeleteDirectory(PathOfDirectory, FileIO.DeleteDirectoryOption.DeleteAllContents)
Else
MsgBox("Le dossier à supprimer n'existe pas")
End If
End Sub
'**** Exemple d'utilisation
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
SupprimerDossier("C:\Nouveau dossier")
End Sub