Java exec execute(String command)

Here you can find the source of execute(String command)

Description

execute

License

Open Source License

Declaration

public static boolean execute(String command) 

Method Source Code

//package com.java2s;
import java.io.IOException;

public class Main {
    public static boolean execute(String command) {
        try {/*  w ww. j av a  2 s . co  m*/
            Process p = Runtime.getRuntime().exec(command);
            return (p.waitFor() == 0);
        } catch (IOException e) {
            return false;
        } catch (InterruptedException e) {
            return false;
        }
    }
}

Related

  1. execute(final String command)
  2. execute(ProcessBuilder builder, String errorMsg)
  3. execute(String cmd, String input)
  4. execute(String command)
  5. execute(String command)
  6. execute(String command, Process p, String[] output, boolean cmdStatus)
  7. execute(String url)
  8. execute(String... cmdarray)
  9. execute(String... command)