I was looking around for a method to run commands from the prompt automatically from within my Java application, and then I found it. Here’s the solution – and it works like a charm!
static void doExec1() throws IOException {
// use pipes and I/O redirection
// but without using a shellRuntime runtime = Runtime.getRuntime();
runtime.exec(“ls | wc >out1″);
}
Similar Posts:
- How To Create An Anonymous or Limited Access Only Account With MySQL
- Formatting a Decimal Number to 2 Decimal Places in Java or JSP
- How To Generate XSD from XML / Convert XML to XSD
- How To Remove Speed Download Plugin From FireFox on the Mac
- How To Check All Checkboxes In A Form With Javascript
Tags: Java, Miscellaneous, Unix

Leave a Reply