I need to set up an app that deletes a folder and all subdirectories, I am using a piece of code that seems to work, except that the sub directories aren't removed from memory (the hard drive stats stay the same). I am assuming that this is not good practice, can anyone help me with the correct way to delete subdirectories. Currently I use this-
Public Function DeleteDirectory(ByVal FullPath As String) _
As Boolean
Dim objDI As New DirectoryInfo(FullPath)
Try
objDI.Delete(True)
Return True
Catch
Return False
End Try
End Function
Thanks for any help
Public Function DeleteDirectory(ByVal FullPath As String) _
As Boolean
Dim objDI As New DirectoryInfo(FullPath)
Try
objDI.Delete(True)
Return True
Catch
Return False
End Try
End Function
Thanks for any help