@echo off set T=c:\TEMP set TOOLS=c:\tools echo ####### %0 ####### takeown /F %T% /R /A /D Y 1>nul icacls %T% /inheritance:r icacls %T% /grant Administrators:F /t /c /l 1>nul icacls %T% /grant Users:RX /t /c /l 1>nul takeown /F %TOOLS% /R /A /D Y 1>nul icacls %TOOLS% /inheritance:r icacls %TOOLS% /grant Administrators:F /t /c /l 1>nul icacls %TOOLS% /grant Users:RX /t /c /l 1>nul takeown /F c:\*.txt /A 1>nul icacls c:\*.txt /inheritance:r icacls c:\*.txt /grant Administrators:F 1>nul icacls c:\*.txt /grant Users:RX 1>nul echo ####### %0 #######