-1

I looked up at several threads on how to switch the read only attribute of folders (most of them do the same for changing file attributes, which is to assign Attributes.Normal to the file's Attributes). I want to select a Directory and have all its subdirectories without the read only flag (I succeeded in doing so for all its files, but I still get the

I have to say that this does not work with me, i.e., it does not change the folder flag. (If I am not wrong I also saw that some people claim this does not work with directories).

I even read some remarks questioning the relevance of the folder Read Only attribute in Windows 7.

So very straightforwardly, is it possible to change a folder read only attribute in Windows 7, using C#? (I also tried changing the directory's DirectorySecurity object to FullControl, Modify, but again to no avail).

Veverke
  • 9,208
  • 4
  • 51
  • 95
  • doesn't [this answer](http://stackoverflow.com/a/2316534/838405) work? – Tobia Zambon Jul 30 '13 at 07:00
  • You can use the `Attrib` cmd http://technet.microsoft.com/en-us/library/bb490868.aspx .. invoke it in a process ..Also check `icalcs` command for folder permissions – Amitd Jul 30 '13 at 07:02

1 Answers1

2

I found two posts related to the same problem

Post 2 suggests that the first one is not correct, but the answer to post 1 has many upvotes

Let us know which answer worked for you

Community
  • 1
  • 1
jorgehmv
  • 3,633
  • 3
  • 25
  • 39
  • The question was to remove the read only flag for a directory and all of its subdirectories. So, there is probably some additional recursion needed. – Axel Kemper Jul 30 '13 at 07:50