Help - batching cacls
jrmeulemans
Member Posts: 74 ■■□□□□□□□□
in Off-Topic
Hey guys I need to know how to do a multiple folder listing for cacls....need NTFS info on lots of folders. I dont just want to use *.*, because the individual files are not important. I need something like:
cacls c:\folder1, folder2, folder3, folder4 /t > c:\output.txt
or even
cacls c:\folder1 > c:\output.txt
cacls c:\folder2 > C:\output.txt
etc.
problem is i need the right syntax, and I can't seem to find it anywhere. Anyone know?
cacls c:\folder1, folder2, folder3, folder4 /t > c:\output.txt
or even
cacls c:\folder1 > c:\output.txt
cacls c:\folder2 > C:\output.txt
etc.
problem is i need the right syntax, and I can't seem to find it anywhere. Anyone know?
Comments
-
RobertKaucher Member Posts: 4,299 ■■■■■■■■■■jrmeulemans wrote: »Hey guys I need to know how to do a multiple folder listing for cacls....need NTFS info on lots of folders. I dont just want to use *.*, because the individual files are not important. I need something like:
cacls c:\folder1, folder2, folder3, folder4 /t > c:\output.txt
or even
cacls c:\folder1 > c:\output.txt
cacls c:\folder2 > C:\output.txt
etc.
problem is i need the right syntax, and I can't seem to find it anywhere. Anyone know?
Use >> to append the text.
cacls c:\folder1 >> c:\output.txt
cacls c:\folder2 >> C:\output.txt
Also you could use the wild card with the /A:D switch to get only directories if cacls let you pipe data to it!
That is slash the letter A a colon the letter D. Not a big grin. dir /a:d /b | cacls >> C:file.txt
But that does not work!
But I suggest powershell:
Get-ChildItem . -exclude *.* | Get-Acl | Export-csv -NoTypeInformation C:\acltest.csv
That should do what you need I think.