You should isolate the code into a separate class that is testable outside of the your JSP. Please please please take notice of the traps article and make sure that you pay proper attention to the quoting of file names,
Can you give more information than "it is not working..."?
What happens when you run it?
Do you get an error message?
Does it complete, but not do what you expect?
Does it put too much sugar in your coffee?
My second question would be - why do you need to trigger an external operation in this manner?
Doing so normally smacks of bad design. What does calling this windows specific batch file accomplish that you can't do in java?
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com