Choose Your Language

Thursday 11 July 2013

Open command prompt using java program

import java.io.IOException;

/**
 *
 * @author Aravind Sankaran
 */
public class OpenCommandPrompt{
     public static void main(String[] abc) {
    try {
          Runtime.getRuntime().exec("cmd /c start ");
         }
    catch (IOException e) {
      System.out.println(e);
        }  
  }
}

No comments:

Post a Comment