You could start it as a Process
and capture the InputStream
of the process as described here:
Runtime runtime = Runtime.getRuntime();
Process process = runtime.exec("ipconfig"); // you might need the full path
InputStream is = process.getInputStream();
InputStreamReader isr = new InputStreamReader(is);
BufferedReader br = new BufferedReader(isr);
String line;
while ((line = br.readLine()) != null) {
System.out.println(line);
}
Edit: I copied this code from above link, but the code seems wrong. Don't you need the output stream for this? Edit2: no.
getInputStream()
Gets the input stream of the subprocess. The stream obtains data
piped from the standard output stream of the process represented by
this Process object.
Nice naming convention...