Recursively remove Windows Read-Only Flag from Files in Folder with Python

326 Views Asked by At

I wonder if there is a proper way to clear the read-only flag from all files in a Folder recursively.

I know how I can do this with batch as mentioned in this SU-Question here

So one way I thought of was to use Python's subprocess to just call this batch command.

No my question is, is there a way with either os, pathlib or anything similar to achieve this?

I know, I could do this with os.chmod combined with os.walk in a loop, but is there a more common way, maybe any kind of a single method call?

0

There are 0 best solutions below