How do I change a file's owner to Everyone
and also allow the Everyone
object Full Access
?
Are there any APIs available for this? Do I have to use P/Invoke?
I searched everywhere but can't find anything to do this.
How do I change a file's owner to Everyone
and also allow the Everyone
object Full Access
?
Are there any APIs available for this? Do I have to use P/Invoke?
I searched everywhere but can't find anything to do this.
You can use
FileInfo.GetAccessControl
andFile.SetAccessControl
methodscheck the sample code given in MSDN link for
File.SetAccessControl
Indeed, there are API's available for this. You may want to have a look at the File.SetAccessControl method in the System.IO namespace.
The forementioned article has tons of great things to play with, regarding the ACL.