Faster way to remove permissions

Status
Not open for further replies.
oh, wow, i don't know why i thought the command said xcacls but i see that now. i should have been doing this on my laptop all along. i do have icacls and takeown though. why would they have 64bit files in system32 but then 32bit files in syswow64?
I don't know why they didn't use system64; you should ask Microsoft.
 
Just realised that /remove:d needs to specify a user
so I'd say it would be /remove:d Administrators /remove:d Users

*edit*
full command:
cmd.exe /c pushd %1 && FOR /R %%X IN (*) DO takeown /a /f "%%X*" && FOR /R %%X IN (*) DO icacls "%%X" /remove:d Users /remove:d Administrators /grant Administrators:F

or you could also add @echo off (you'd still get the output from icacls, just not the commands used):
cmd.exe /c @echo off && pushd %1 && FOR /R %%X IN (*) DO takeown /a /f "%%X" && FOR /R %%X IN (*) DO icacls "%%X" /remove:d Users /remove:d Administrators /grant Administrators:F
 
Status
Not open for further replies.
Back
Top Bottom