I assume you're using the ManagementClass
to create a shared folder.
Setting the Access field of your ManagementBaseObject
should give full control to everyone:
ManagementClass mc = new ManagementClass("win32_share");
ManagementBaseObject inParams = mc.GetMethodParameters("Create");
inParams["Description"] = "Shared Folder";
// ... whathever ...
inParams["Access"] = null; // <-- should give full control access to everyone
If the above doesn't work you might wanna try explicitly setting the security level with smt like the following:
public static void AddDirectorySecurity(string FileName, string Account, FileSystemRights Rights, AccessControlType ControlType)
{
DirectoryInfo dInfo = new DirectoryInfo(FileName);
DirectorySecurity dSecurity = dInfo.GetAccessControl();
// Add the FileSystemAccessRule to the security settings.
dSecurity.AddAccessRule(new FileSystemAccessRule(Account,
Rights,
ControlType));
// Set the new access settings.
dInfo.SetAccessControl(dSecurity);
}
If none of the above helps, then I'd suggest you post your code.