Quick question regarding CACLS

  • Thread starter Thread starter Synapse Syndrome
  • Start date Start date
S

Synapse Syndrome

Guest
I want to find any folders on a drive that the Administrator account may not
be able to access. What CACLS command should I use for this?

Cheers

ss.
 
Re: Quick question regarding CACLS


"Synapse Syndrome" <synapse@NOSPAMsyndrome.me.uk> wrote in message
news:e$M9KsgOJHA.1144@TK2MSFTNGP05.phx.gbl...
>I want to find any folders on a drive that the Administrator account may
>not be able to access. What CACLS command should I use for this?
>
> Cheers
>
> ss.


I don't think that a raw cacls command can do this. However, the batch file
below might do the job. It will identify all folders whose ACL does not
include "Administrator" or "Everyone".
01. @echo off
02. set User=Administrator
03. set Target=E:\Backup Folder
04. set Logfile=c:\cacls.txt
05.
06. echo Permission list compiled on %date% at %time% > %Logfile%
07. echo List of folders whose ACL includes neither %User% nor "Everyone" >>
%Logfile%
08. echo. >> %Logfile%
09. echo Compiling the permission list. Please wait . . .
10. for /F "delims=" %%a in ('dir /b /s /ad "%Target%"') do (
11. echo Processing "%%a"
12. cacls "%%a" | findstr /i "%User% Everyone" > nul || echo %%a >>
%Logfile%
13. )
14. notepad %Logfile%

The batch file works recursively. To speed up its operation, remote the "/s"
switch in Line #10 to make it non-recursive.
 
Re: Quick question regarding CACLS

On Oct 29, 3:12 pm, "Synapse Syndrome" <syna...@NOSPAMsyndrome.me.uk>
wrote:
> I want to find any folders on a drive that the Administrator account may not
> be able to access.  What CACLS command should I use for this?
>
> Cheers
>
> ss.


Hello, Synapse::
As you may already know, "Help & Support > CACLS" yields some
pretty good tutorial-material.
One example: Say the directory you want to modify is "C:\X".
Open a cmd-prompt window. Navigate to the desired folder. Type:
cacls /t /c /g administrators:f
hit Enter.
Good Luck.
riprap
 
Back
Top