I am deleting log files >= 2 days old on a server with the following code:
'Iterate through all files in specified path
For Each file As IO.FileInfo In New IO.DirectoryInfo(sDirPath).GetFiles(sFileType)
'Delete all log files 2 days old or older
If (Now - file.CreationTime).Days >= iNumDays Then
file.Delete()
End If
Next
This code works find on a regular windows machine. On the server, it is setup to query the user for Administrative permissions and click continue to delete the file. I have admin rights on the server. My question is, how do you "click Continue" in code when the file.Delete method is executed?