Hi, How to execute a command line program in jsp or servlet? 

In a test program, I tried to execute a batch program in a jsp file and it
didn't work. The batch program test.bat only has on simple line:

 

dir > lst.txt

 

In the test.jsp I called the batch program as following:

 

try{

Runtime rt = Runtime.getRuntime();

            rt.exec("c:\\test.bat");

}catch(IOException e){

            out.println(e.getMessage());

}

 

Any help?

 

Thanks,

Jack Li

            

Reply via email to