M
Mike
I am using vb.net, visual studio 2005 and running XP as an admin. My code
works fine for all but two folders in the parent folder. It deletes the
files and all other folders. There are 2 that will not delete. All have the
same attributes that I can see. I know I am missing something but I can't
find it. I have looked for hidden files but there aren't any. Any thing
else I can consider?
Thanks
Mike
Relevant code:
ClearFolder(di)
Directory.Delete(strPathToRead & strFolderPath, True) <--- Error on this line
Error I get:
Access to the path 'D:\My Plates\Only3folders_13\0034573' is denied.
Private Sub ClearFolder(ByVal di As DirectoryInfo)
Dim subdi As DirectoryInfo() = di.GetDirectories()
Dim f As FileInfo
For Each d As DirectoryInfo In subdi
Dim fi As FileInfo() = d.GetFiles()
For Each f In fi
f.Attributes = FileAttributes.Normal
f.Delete()
Next
ClearFolder(d)
Next
End Sub
works fine for all but two folders in the parent folder. It deletes the
files and all other folders. There are 2 that will not delete. All have the
same attributes that I can see. I know I am missing something but I can't
find it. I have looked for hidden files but there aren't any. Any thing
else I can consider?
Thanks
Mike
Relevant code:
ClearFolder(di)
Directory.Delete(strPathToRead & strFolderPath, True) <--- Error on this line
Error I get:
Access to the path 'D:\My Plates\Only3folders_13\0034573' is denied.
Private Sub ClearFolder(ByVal di As DirectoryInfo)
Dim subdi As DirectoryInfo() = di.GetDirectories()
Dim f As FileInfo
For Each d As DirectoryInfo In subdi
Dim fi As FileInfo() = d.GetFiles()
For Each f In fi
f.Attributes = FileAttributes.Normal
f.Delete()
Next
ClearFolder(d)
Next
End Sub