YMartin
asked on
batch file for syntax problem windows 7 cmd prompt
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.
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.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Also, peek at this page might give you some ideas:
http://www.robvanderwoude.com/ntadmincommands.php#Cmd09
http://www.robvanderwoude.com/ntadmincommands.php#Cmd09
ASKER
That was it.
dir c:\some_folder /A:D /D /B>userlist.txt
FOR /f %%D IN (userlist.txt) DO (
ECHO %%a || icacls %%! | find /i "domain users"
)