These days, I recommend biterscripting over batch scripting. It supports variables of several data types, has generous parsing/extracting/modifying/tokenizing commands. Once a script is written, it will work the exact same way on all operating systems, so you won't face any issues when you upgrade your operating system.
You will see several biterscripts posted all over the web. Start with the one that's closest to your requirements. Biterscripting itself can be downloaded from http://www.biterscripting.com or any other download web site. Just google it up.
Sen