Quick question regarding CACLS

S

Synapse Syndrome

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.
 
P

Pegasus \(MVP\)

Synapse Syndrome said:
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.
 
R

riprap

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top