I want to set a file to be writeable by all users.
FileSecurity sec = File.GetAccessControl(fileName);
string users = ?????;
sec.AddAccessRule(new FileSystemAccessRule(
users,
FileSystemRights.Write,
AccessControlType.Allow));
File.SetAccessControl(fileName, sec);
The problem is that I don't know which string to use. I have tried users = WindowsAccountType.Normal.ToString()
, but that only gives "Normal"
, which doesn't work. How can I get the string that designates the group of all users on a machine?