2
1
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?
Wouldn't that be
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.. – Kody Brown – 2015-12-19T15:20:06.047How's using wildcards any different? – whatever1234566 – 2015-12-20T01:54:19.923
Just that
*.
can pick up files and folders without an extension, just like*.*
can pick up both files and folders with an extension. – Kody Brown – 2015-12-20T03:33:06.203Using
dir /ad
will only list directories anddir /a-d
will 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%%G
instead of%G
.) – Kody Brown – 2015-12-20T03:48:46.543