Windows 10 reset NTFS permissions

RunAs Administrator:

cd some_directory
icacls * /t /q /c /reset
takeown /R /F *
icacls * /t /grant Everyone:F
cd ..
REM to save and restore permissions
icacls _directory_ /save _filename_
icacls _directory_ /restore _filename_


REM Backup permissions of WindowsApps
icacls "%ProgramFiles%\WindowsApps" /save WindowsApps.acl /t

REM restore permissions
icacls "%ProgramFiles%" /restore WindowsApps.acl

Reference: icacls reference