G
Guest
Hello.
I'm trying to write a simple VS.NET 2003 VB program to delete files and
directories on my hard drive. If the directory is read only, how do i change
it's attribute so that i can delete it ?
Here is some of my code. It does not error out, it just does not delete the
directories.
Any help would be gratefully appreciated even ideas on another way to do this.
I'm new at all this, so any pointers that any body can give would also be
appreciated.
Thanks,
Tony
Try
Dim dirsb() As String = Directory.GetFiles("C:\Documents and
Settings\Administrator\Local Settings\Temp")
For Each dirx In dirsb
Directory.Delete(dirx, True)
Next
Catch ex As Exception
Exit Try
End Try
I'm trying to write a simple VS.NET 2003 VB program to delete files and
directories on my hard drive. If the directory is read only, how do i change
it's attribute so that i can delete it ?
Here is some of my code. It does not error out, it just does not delete the
directories.
Any help would be gratefully appreciated even ideas on another way to do this.
I'm new at all this, so any pointers that any body can give would also be
appreciated.
Thanks,
Tony
Try
Dim dirsb() As String = Directory.GetFiles("C:\Documents and
Settings\Administrator\Local Settings\Temp")
For Each dirx In dirsb
Directory.Delete(dirx, True)
Next
Catch ex As Exception
Exit Try
End Try