How can I programatically remove the readonly attribute from a directory in C#?
If your folder keeps reverting to read-only it could be due to a recent Windows 10 upgrade. Many users have reported that when upgrading their system to Windows 10, they encountered this error. Read-only is a file/folder attribute that lets only a specific group of users read or edit the files or folder.
var di = new DirectoryInfo("SomeFolder"); di.Attributes &= ~FileAttributes.ReadOnly;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With