#1 12 Dec 2014 14:55

boushta
Member
Registered: 20 May 2014
Posts: 14

icacls setting permissions problems

please how can use icacls to deny users from file and directories deletion recursively,i tried the following code and it didn't work

set "root=d:\TestFolder"
for %%G in (%root%) do (
	takeown /f "%%~G" /r /d Y
      
        Icacls "%%~G"  /Deny "%username%":d /T /C & rem this sets the permission but not recursively
	Icacls "%%~G"  /Deny "%username%":(OI)(CI)d  /T /C & rem this outputs the error "(CI)d was unexpected."
	Icacls "%%~G" /T /C (OI)(CI) /Deny "%username%":D  & rem this outputs the error "(CI) was unexpected."

) 

Last edited by boushta (23 Dec 2014 20:03)

Offline

Board footer

Powered by FluxBB