I wrote a batch file to provide folder(D:\Test) access to list of user present in a txt(D:\users) file . Now I want a log file(D:\log) having names of who were provided access.
Here is my code:
FOR /F "delims=" %%A in (D:\users.txt) DO icacls "D:\Test" /grant %%A:(OI)(CI)F /T > D:\log.txt
Output in log file:
Successfully processed 0 files; Failed processing 1 files
But I want those names who were given access.
Note:- D:\users text file contains correct user names and incorrect user names also.