Windows: How do I remove a file's ACL, and just let it inherit the ACL on the containing directory?

4

3

Scenario: I unpack a file into a temp directory.

Then I movve the file into a different directory. I want the file ACL to only include the perms stipulated in the new containing directory. How can I make that happen?

In UI, and in command line would be good. icacls?

Cheeso

Posted 2009-12-23T18:56:57.300

Reputation: 2 002

Answers

4

You could use the reset function of icacls:

ICACLS "C:\path\to\folder" /reset /T /C

then enable inheritance:

ICACLS "C:\path\to\folder" /inheritance:e /T /C

John T

Posted 2009-12-23T18:56:57.300

Reputation: 149 037

/inheritance is not listed as a parameter on the icacls documentation page. – Michael - Where's Clay Shirky – 2015-09-29T15:34:45.107

On Windows XP, I'm getting Invalid parameter "/inheritance:e", any idea? (I've installed icacls a couple of weeks ago, so I don't think upgrading would help). – maaartinus – 2011-05-14T15:53:45.260