As mentioned in my initial post, even with Avast disabled, setting attribute fails.
And to be 100% sure of my asumptions, I just ran a new test.
On VirtualBox, I open a fresh install of Win 7 (and nothing else)
On this environment, by default, "C:\Program Files" has RO attribute set.
From a shell window (open with admin rights) I'm able to
- remove it (attrib -R "C:\Program Files") : Attribute is removed
- set it again (attrib +R "C:\Program Files") : Attribute is set
On this environment plus Avast (and only Avast, nothing else)
I'm still able to remove RO attribute, but I'm no more able to set it again ! Command attrib +R "C:\Program Files" do not generate any error message, but attribute is not set !
On this latest environment, I only de-install Avast (and nothing else)
As a result, I'm now able again to set RO attribute !
Clearly, it is Avast that prevented me to set the RO attribute.
So, I agree with LeahG, Avast should not prevent me from setting RO attribute, but actually, it does....