Go4Expert (http://www.go4expert.com/)
-   Java (http://www.go4expert.com/forums/java/)
-   -   Executing a batch file from a JSP page (http://www.go4expert.com/forums/executing-batch-file-jsp-page-t6734/)

vineetha 8Oct2007 13:52

Executing a batch file from a JSP page

I am trying to execute a batch file from a JSP page.But when i run the JSP page using tomcat,my tomcat stops the service.I am using Tomcat version 5.5 and JDK version 1.5.
But when i run the same code using command prompt,i get the output.
The following are the contents of my JSP page.

HTML Code:

<title>hello world</html>
<body bgcolor=pink>

{ Process proc = Runtime.getRuntime().exec("C:/vin.bat");
catch (Throwable t)



The batch file vin.bat contains the following lines:
start c:/hello.txt

Pls help me to figure out a solution.

Thanks & Regards,

All times are GMT +5.5. The time now is 09:11.