java - Command prompt doesn't open with Runtime.getRuntime().exec -
i've created gui (swing) executes batch file contains command prompt .exe file execution specific parameters. when run batch file manually (by double clicking it), expected. problem is: command prompt window doesn't open show progress, moreover, doesn't start work (only initiated) until exit gui (forking?). when starts work, works somewhere in background , seen in task manager. blank command prompt window opened.
from digging little bit around, i've constructed command gives me same result above:
runtime.getruntime().exec("cmd.exe /c start \"encoding\" cmd.exe /c start md \"" + gui.outputdirfield.gettext() + "\\encoderoutput\" & cd \"" + gui.outputdirfield.gettext() + "\\encoderoutput\" & \"" + gui._batfile + "\" & pause");
could please assist?
sorry if sounds stupid..
this way works me:
new thread() { @override public void run() { try { runtime.getruntime().exec("cmd.exe /c start " + gui._batfile); } catch (ioexception e1) { e1.printstacktrace(); } } }.run();
Comments
Post a Comment