I have the following windows batch file (run.bat):
@echo off echo hello batch file to sysout
And the following java code, which runs the ba
This is the simplest method i found on http://tamanmohamed.blogspot.in/2012/06/jdk7-processbuilder-and-how-redirecting.html
File output = new File("C:/PBExample/ProcessLog.txt"); ProcessBuilder pb = new ProcessBuilder("cmd"); pb.redirectOutput(output);