I am creating a Process in java which opens my batch file and runs perfectly fine.
Process p = Runtime.getRuntime().exec("cmd /c start c:\\blah\\example.bat");
OutputStream out = p.getOutputStream();
How do I insert a command in this example.bat file for example inserting "cd.." through java??
You can write the batch file from Java with a FileWriter
, prior to executing it.