executing a few command lines from java -


i want execute few lines java code didn't know how.

cd c:\\apps\\dcm4che-2.0.28\\dcm4che-tool\\dcm4che-tool-txt2dcmsr\\src\\bin   txt2dcmsr.bat -c c:\\apps\\dcm4che-2.0.28\\dcm4che-tool\\dcm4che-tool-txt2dcmsr\\src\\etc\\txt2dcmsr.cfg c:\\users\\intidhar\\desktop\\input\\tst.txt \"c:\\users\\intidhar\\desktop\\output\\tst.dcm 

i wrote lines of java code didn't work:

try {      runtime runtime = runtime.getruntime();     runtime.exec("c:\\apps\\dcm4che-2.0.28\\dcm4che-tool\\dcm4che-tool-txt2dcmsr\\src\\bin\\txt2dcmsr.bat -c \"c:\\apps\\dcm4che-2.0.28\\dcm4che-tool\\dcm4che-tool-txt2dcmsr\\src\\etc\\txt2dcmsr.cfg\" \"c:\\users\\intidhar\\desktop\\input\\tst.txt\" \"c:\\users\\intidhar\\desktop\\output\\tst.dcm\"");     } catch (ioexception e) {      e.printstacktrace();     } 


Comments