package two;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
public class Rrrr{
public static void main(String[] args) {
Runtime rn = Runtime.getRuntime();
Process p = null;
try {
//cmd /c是调用cmd下的start命令,它相当于对一个文件双击
// p = rn.exec( "cmd /k dir ");
// p = rn.exec("cmd /C Start D:\\ss.txt");
// p = rn.exec("cmd /C Start D:\\e");
p = rn.exec("cmd /C Start D:\\SQLyogEE-v7.14H\\SQLyogEnt.exe");
int status=p.waitFor();
if (status == 0)
{System.out.println("执行完毕");}
else
{System.out.println("执行失败");}
// InputStream in = p.getInputStream();
// BufferedReader br = new BufferedReader(new InputStreamReader(in));
// String str = null;
// while ((str = br.readLine()) != null) {
// System.out.println(str);
// }
// br.close();
} catch (Exception e) {
System.out.println("Error exec notepad ");
}
}
}