On Thu, 28 Apr 2005 18:28:05 -0700, John Grandy wrote:
How to remove "Read Only" status on a file on a remote server?
My goal is to delete the file, but
System.File.Delete(\\machine1\c$\folder1\file1.txt )
is giving me an "Access is denied" error.
My log-on account is member of MACHINE1's local Administrators group.
To remove an attribute use System.IO.File.SetAttributes. Ex:
System.IO.FileAttributes atts =
System.IO.File.GetAttributes(@"\\machine1\c$\folde r1\file1.txt");
atts &= ~System.IO.FileAttributes.ReadOnly;
System.IO.File.SetAttributes(@"\\machine1\c$\folde r1\file1.txt", atts);
--
Tom Porterfield