How to capture the output of another program into a File/String
I needed to capture the output of a dos program in an String/file I tried doing Runtime.getRuntime.exec("ipconfig /all >tmp.txt");but still I am unable to capture the output frm the program which I would like to capture in a file or String.Can anyone help
[279 byte] By [
ebistro] at [2007-9-26 4:11:38]

When you use the Runtime.exec() method, it returns a Process object, that process object has access to the streams; stdout, stdin, and stderr of the application you just executed. what you'll want to monitor is the stdout or stderr streams using the
p.getInputStream() or p.getErrorStream(), where p = the process object returned via the Runtime.exe() method.