i'm trying to delete some files in a Windows application but I'm getting an Access denied error. The path is a share, and I've setthe share permissionsfor Everyone to Full Access. I've also set thefile permissions on all files and the folder they're infor Everyone to Full Access.I can manually delete the files in question, naturally.
A couple of questions: What's the default identity for a Windows application? Is it the user who launched the application? Anyone have any ideas?
Here's the code:
Dim sFiles() As String = x.GetFiles("\\myserver\myshare\", "*.txt")
Dim FI As FileInfo
For i As Integer = 0 To sFiles.GetUpperBound(0)
FI = New FileInfo(sFiles(i))
If DateDiff(DateInterval.Day, FI.LastWriteTime, Now) >= iDaysOld Then
File.Delete(sFiles(i)) 'kicks out Access Denied error with the path above, with c:\temp\ it works fine
End If
Next
Thanks Alex