I want to make a list of access denied files/folders for a given account. I'm aware "icacls" handles making lists of files/folders given an account name.
e.g. This command lists access denied per folder on screen:
icacls c:\*. /findsid "User" /T /C /L /Q > c:\results.txt
...but it doesn't list the access denied folders in the results file.
How can I do this?
icacls c:*.* /findsid "User" /T /C /L /Q > c:\updatedFiles.txt 2> c:\accessDeniedFiles.txt..? Another thought is that usingc:*.andc:*.*is not 100% accurate. You will get better (ie: more accurate) results if you use afor (dir /AD)statement.. – kodybrown Dec 19 '15 at 15:20*.can pick up files and folders without an extension, just like*.*can pick up both files and folders with an extension. – kodybrown Dec 20 '15 at 03:33dir /adwill only list directories anddir /a-dwill only list files. Using them in a 'for' loop would look like this:for /f %G in ('"dir /ad /b"') do @echo %G.. (When using the for loop inside a batch file, be sure to use%%Ginstead of%G.) – kodybrown Dec 20 '15 at 03:48