Use the class System.Security.AccessControl.DirectorySecurity
to request access as an administrator. Applications authenticate to have administrator permissions in this way, and not just running as administrator.
The code should look like the following:
string user = "X"; // Troque X pelo nome de usuário de um administrador.
System.IO.DirectoryInfo folderInfo = new IO.DirectoryInfo("C:\2953323222e00ecf35c7");
DirectorySecurity ds = new DirectorySecurity();
ds.AddAccessRule(new FileSystemAccessRule(user, FileSystemRights.Modify, AccessControlType.Allow));
ds.SetAccessRuleProtection(false, false);
folderInfo.SetAccessControl(ds);
If the above code doesn’t resolve as is, take a look at the documentation to get the exact permission you need.
Credits - I got the code of this question in the English OS:
Visual Basic . NET Access to the path 'C: ' is denied
running as administrator
– Rovann Linhalis
@Rovann Linhalis I ran as an administrator, not Ressoulveu.
– isaque
what is
2953323222e00ecf35c7
? a briefcase ?– Rovann Linhalis
@Rovannlinhalis Yes
– isaque
possibly is a protected operating system folder, you need to access it or you can ignore it ?
– Rovann Linhalis