Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class OpenBatchFile {
- public OpenBatchFile() {
- super();
- }
- /**Main Method
- * @param args
- */
- public static void main(String[] args) {
- //Get Runtime object
- Runtime runtime = Runtime.getRuntime();
- try {
- //Pass string in this format to open Batch file
- runtime.exec("cmd /c start Desktop:\OpenNotepad.bat");
- } catch (IOException e) {
- System.out.println(e);
- }
- }
- }
Add Comment
Please, Sign In to add comment