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.
e.g.
Dim Files() As String = IO.Directory.GetFiles(ThePath)
For Each File In Files
IO.File.Delete(File)
Next