unable to start .bat file from JSP-Collection of common programming errors
First, JSP is the wrong place for this. Do it in a real Java class. Start with a Servlet. Have a form with a button which submits to a servlet. Put this code in the doPost()
method. Let the servlet put the result in request scope and forward the request to a JSP. Let the JSP display the result.
Second, learn the pitfalls of Runtime#exec()
in this article. Your problem is that you aren’t checking the result nor the error stream (and thus never knows if the program executed successfully) and that you are expecting that it somehow runs in sync with your coding (while it actually runs in a separate thread/process). You’re basically doing a “fire and forget”, the code is basically not tracking the execution/termination of the program in any way.
This problem has by the way nothing to do with JSP. You would face exactly the same problem when doing so in a normal Java class.