Set Folder Permission with CSV File RRS feed

  • Question

  • I currently have a batch file that I use to set the folder permission on a users folder.  The batch file of course requires me to manually set two variables.  I'd like to have a master csv file containing this info and a powershell script to allow me to set these permission much more quickly.  Here's my current batch file:

    Set User=123A

    Set Folder=123

    icacls C:\Data\%folder% /grant %user%:(OI)(CI)F

    My csv file would appear as 123A,123

    I did do a search and found a few posts on this subject, but couldn't wrap my head around how to modify them to fit my needs.


    Tuesday, October 28, 2014 6:09 PM


  • FOR /F "eol=; tokens=1,2* delims=, " %%i in (myfile.txt) do icacls C:\Data\%%j /grant %%i:(OI)(CI)F


    • Marked as answer by bakerkr94 Wednesday, October 29, 2014 12:36 PM
    Tuesday, October 28, 2014 6:27 PM

All replies