How to give full access to a folder for everyone?
Is there any way to do it programmatically, using a .bat file or a script?
Use a tool called iCacls from microsoft.
This page illustrates the exact thing that you need.
Since it supports command line operation, you can easily write a batch with it.
PS: The guy is initially saying that it isn't working on win 7. BUT, go down the comments and he got it to work.