<span style="font-size:18px;">class Tester { public static void main(String args[]) throws Exception { Runtime r = Runtime.getRuntime() ; //Process p = r.exec("notepad.exe") ; //打开windows记事本 //Process p = r.exec("mspaint.exe") ; //打开windows画图 Process p = r.exec("calc.exe") ; //打开windows计算器 Thread.sleep(5000) ; //定义关闭进程时间 p.destroy() ; //关闭进程 } }</span>
原文地址:http://blog.csdn.net/u012566693/article/details/44917377