Get output from BAT file using Java-Collection of common programming errors

Using “cmd /c start […]” to run a batch file will create a sub process instead of running your batch file directly.

Thus, you won’t have access to its output. To make it work, you should use:

String cmd = "C:\\workspace\\temp.bat";

It works under Windows XP.