Discussion Locked

Searching for permissions...

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I need to find all files in a directory tree that no longer have the "Everyone" "All access" permission.

Is this possible? How do I do it? Thanks.

3 replies

by beermonster

Hi, copy the below into a batch file, change the directory name to the directory you want to check. check also that when you copy it over that the lines - esp the rem comments - haven't been wrapped round to the line below. Have fun....

rem (c) The Beermonster 2002
If exist c:\filelist.txt del c:\filelist.txt

rem get a list of the files and directories
rem within the target directory
dir c:\mydirectory\ /s /b > cacltest.txt

rem parse that list for each entry and pass it to rem the sub procedure
for /F "tokens=*" %%A in (c:\cacltest.txt) do call :go "%%A"
goto end

rem use cacls to check the perms,
rem if the everyone group with full perms is not rem found,
rem echo the file or directory name to a txt file.
:go
cacls %1 | find /I "Everyone:F"
If "%errorlevel%"=="0" got end
echo %1 >> c:\filelist.txt
:end

This discussion is closed to new replies.