Having problems with a batch file which runs a command on each subfolder. Googling has told me this should list each subfolder name. It does not. It lists 'dir' then '/b'. It is treating the array as literal text rather than the output of the dir /b * command.
for /d %%a in ('dir /b *') do echo %%a || icacls %%! | find /i "domain users"
I am trying to run icacls on each folder and search the output for "domain users" to see what the permissions are for domain users.