| 78 | | //Set the date of the file to be invalid to prevent forensic |
| 79 | | //detection |
| 80 | | info.Attributes = FileAttributes.NotContentIndexed; |
| | 78 | //Reset the file attributes to non-content indexed so indexing |
| | 79 | //services will not lock the file. |
| | 80 | try |
| | 81 | { |
| | 82 | info.Attributes = FileAttributes.NotContentIndexed; |
| | 83 | } |
| | 84 | catch (ArgumentException e) |
| | 85 | { |
| | 86 | //This is an undocumented exception: when the path we are setting |
| | 87 | //cannot be accessed (ERROR_ACCESS_DENIED is returned) an |
| | 88 | //ArgumentException is raised (no idea why!) |
| | 89 | throw new UnauthorizedAccessException(e.Message, e); |
| | 90 | } |