Code:
Save as "Notepad.java" and Compile and Run it.Code:class Notepad{ public static void main(String arg[]){ Runtime r=Runtime.getRuntime(); Process p=null; try { p=r.exec("notepad"); p.waitFor(); } catch(Exception e) { System.out.print("Fail to Open Notepad Opened"); } System.out.print("Notepad Closed"+p.exitValue()); } }
Good Luck.


LinkBack URL
About LinkBacks


Reply With Quote


