It sounds to me like you don't have delete directory permission to the folder. From the same machine, are you able to delete the folder manually. If you have permission to delete the contents manually, then you should be able to manually iterate through the files and then delete them.
Dim Files() As String = IO.Directory.GetFiles(ThePath)
For Each File In Files