eclipse - java runtime.exec() not working on tomcat -


runtime.exec() not working on tomcat.

i have problem in running command java web application. used runtime.exec(). it's working fine @ eclipse. not working @ after deployed on tomcat. think runtime.exec() not working @ all. idea?

i written @ server side. want create windows schedule task runtime. here code.

string l_time = pdata.gettimestamp(); processbuilder builder = new processbuilder("cmd", "/c", "start  schtasks /create " +                 "/sc weekly /d mon,tue,wed,thu,fri,sat,sun /tn \"taskname\"" +                 " /tr \"d:/test/test.bat\" /st 09:00\""); builder.redirecterrorstream(true); process p = builder.start();  bufferedreader r = new bufferedreader(new inputstreamreader(p.getinputstream())); string line; while (true) {     line = r.readline();     if (line == null) { break; }         system.out.println(line); } p.waitfor(); int exitval = p.exitvalue(); system.out.println("process exitvalue: " + exitval); 

if trying execute in runtime.exec() not work in client side


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -

php - Accessing static methods using newly created $obj or using class Name -