Displaying getRuntime().exec() Process CMD Window
Hello,
I'm using Runtime.exec() to run some Windows XP SP2 command line arguments from the command prompt, namely, an ftp client. The code looks something like:
Process p = Runtime.getRuntime().exec("cmd /c \"cd this && that.bat -script script.txt\"");
Now, this works, but I want the command prompt window to pop-up, so that the user can see the process running (it is a long process).
How can I achieve this?
[450 byte] By [
bigOlogNa] at [2007-11-27 11:05:26]

> Now, this works, but I want the command prompt window
> to pop-up, so that the user can see the process
> running (it is a long process).
>
> How can I achieve this?
It is easier to capture the process stdout and display it in a Frame or JFrame.
Yes, you would start a thread that reads from the output stream and appends to something like a JTextArea.
Note that JTextArea's append method is thread safe, i.e. you can call it right from the worker thread.
dwga at 2007-7-29 13:08:41 >
