Answers for "Execute command java"

2

java run system command

Runtime.getRuntime().exec(cmdAttribs);
Posted by: Guest on September-06-2021
1

java run cmd

public void excCommand(String new_dir){
    Runtime rt = Runtime.getRuntime();
    try {
        rt.exec(new String[]{"cmd.exe","/c","start"});

    } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
}
Posted by: Guest on July-05-2021

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language