package com.ca.common;
import java.io.IOException;
public class RunBatchFile {
public static void main(String[] args) {
System.out.println("processing Main...");
String batchFile = "D:/copy.bat";
Runtime runtime = Runtime.getRuntime();
try {
runtime.exec(batchFile);
} catch (IOException e) {
e.printStackTrace();
}
System.out.println("Done!");
}
}
Showing posts with label Java. Show all posts
Showing posts with label Java. Show all posts
Friday, January 14, 2011
Java code to execute batch file.
Subscribe to:
Posts (Atom)