HELP is your friend. See HELP SET and HELP FOR. Good readings, there.
Also, my script is, of course, a bit complicated.
Finish programming 1 and I'll show you my code. If you really want to do it in batch, I'll warn you in advance that you wont just need to be able to make a batch that can do the job, but one that can do the job quickly