Delete Directory Using VB.NET
In this article I describe how to delete directory using VB.NET.
Delete a Directory Using VB.NET
The Directory.Delete method deletes an empty directory from the specified path permanently. If a directory has subdirectories and/or files, you must delete them before you can delete a directory. If you try to delete a file that is not empty, you will get an error message.
The following code snippet deletes the destination file.
Dim root As String = "C:\Temp"
'If directory does not exist, don't even try
If Directory.Exists(root) Then
Execute above code and you will see, Temp directory is deleted from C: Drive.