Tu peux toujours y allez avec la fonction RmDir de VB mais elle ne supprime que les dossier vide, qui ne contient aucun fichiers n'y sous-dossiers, ...
Pour supprimer un répertoire tu peux utiliser une API
Exemple avec l'API SHFileOperation
Tu peux coller le code d'une form par exemple
'Le type
Private Type SHFILEOPSTRUCT
hWnd As Long
wFunc As Long
pFrom As String
pTo As String
fFlags As Integer
fAborted As Boolean
hNameMaps As Long
sProgress As String
End Type
' Déclaration de l'API
Private Declare Function SHFileOperation Lib "shell32.dll" Alias "SHFileOperationA" (lpFileOp As SHFILEOPSTRUCT) As Long
' Les constantes
Public Const FO_COPY = &H2
Public Const FO_DELETE = &H3
Public Const FO_MOVE = &H1
Public Const FO_RENAME = &H4
Public Const FOF_ALLOWUNDO = &H40
Public Const FOF_CONFIRMMOUSE = &H2
Public Const FOF_FILESONLY = &H80
Public Const FOF_MULTIDESTFILES = &H1
Public Const FOF_NO_CONNECTED_ELEMENTS = &H2000
Public Const FOF_NOCONFIRMATION = &H10
Public Const FOF_NOCONFIRMMKDIR = &H200
Public Const FOF_NOCOPYSECURITYATTRIBS = &H0800
Public Const FOF_NOERRORUI = &H0400
Public Const FOF_NORECURSION = &H1000
Public Const FOF_RENAMEONCOLLISION = &H8
Public Const FOF_SILENT = &H4
Public Const FOF_SIMPLEPROGRESS = &H100
Public Const FOF_WANTMAPPINGHANDLE = &H20
Public Const FOF_WANTNUKEWARNING = &H4000
' La fonction
Public Function DeleteDirectory(ByVal DirectoryName As String) As Long
J'ai utiliser une API(SHFileOperation) dans l'exemple parce qu'il va pouvoir voir la progression de la suppression de son répertoire, avec le FileSystemObject on ne voit rien... c'est utile quand on à de gros répertoire à supprimer, en plus on peut choisir si on veut supprimer définitivement le répertoire ou simplement l'envoyer à la corbeille, on peut aussi annuler la suppression, etc... bref moi je préfère l'API SHFileOperation...