I've seen it asked here how to remove the Read-only attribute for a files and folders manually, but my question is a little different, and if it's been asked and answered, then I apologize. I did search first and didn't find anything.
Sometimes when I download a file or archive from the internet, it has the Read-only attribute set either on the file or archive itself, or on files and folders within the archive (probably set by the person who uploaded it). This can cause the program I use to access the file to throw an "access denied" error. I know how to clear the attribute manually using the attrib command, but I'd like to know if there's a way to remove the attribute automatically for all files when I download them, and/or when they are unpacked. If not, then could the following or a similar process be another way to achieve what I want (which is simply to not run into the error below, without having to manually remove the offending attribute case-by-case)?
(I'm the only user and my account is also the primary administrator, and "Owner" is already set to me) Downloads>Properties>Security>Advanced>check "Replace all child object permission entries with inheritable permission entries from this object">Apply>OK>OK
For context, I use an application that uses python scripts to automatically unpack a downloaded archive using 7zip, and move the files to another location on the same drive. This is all happening outside of Windows protected space (on my D:\ drive). The specific error being thrown is "[Winerror 5] Access is denied."