Is this homework?
If so most of the ways to achieve this will be in the book that your studying. I feel that if we gave you a pointer on how to do it, we would be giving away the answers.
Can you share code example of what you have now and we can point out corrections maybe? I dont like to do peoples homework for them, but I dont mind pointing out corrections to be made.... I guess I am saying that I am willing to help, but not do all the work for you.
*Also a common mistake I have seen with using notepad when creating batch files is that the batch file is saved as a text file because notepad saves to .txt by default, so you will want your batch files to have the .bat file extension. Just wanted to mention in case you didnt know this. Other mistakes are in naming the batch file a similar name to that of an already existing program or command, so its best to name it something like test1.bat or homework1.bat to avoid naming conflicts.