daily pastebin goal
32%
SHARE
TWEET

Untitled

a guest Nov 22nd, 2017 51 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public class OpenBatchFile {
  2. public OpenBatchFile() {
  3.     super();
  4. }
  5.  
  6. /**Main Method
  7.  * @param args
  8.  */
  9. public static void main(String[] args) {
  10.     //Get Runtime object
  11.     Runtime runtime = Runtime.getRuntime();
  12.     try {
  13.         //Pass string in this format to open Batch file
  14.         runtime.exec("cmd /c start Desktop:\OpenNotepad.bat");
  15.     } catch (IOException e) {
  16.         System.out.println(e);
  17.     }
  18.   }
  19. }
RAW Paste Data
Top