You can write such scripts using the utility CACLS.EXE, here is the help on it: http://ss64.com/nt/cacls.html
CACLS > cacls.help.txt
to obtain the text file with the options of the utility currently available in your system.
Needless to say, the account on which your batch script is executed should have enough permission to modify the permissions in questions. You can check this in UI using the properties dialog of the file system object you are interested in.