Results 1 to 1 of 1
-
Using Runtime to execute external commands
You may execute external commands using Runtime as shown below.
Java Code:try { String line; Process p = Runtime.getRuntime().exec (System.getenv("windir") +"\\system32\\"+"tree.com /A"); BufferedReader input = new BufferedReader (new InputStreamReader(p.getInputStream())); while ((line = input.readLine()) != null) { System.out.println(line); } input.close(); } catch (Exception err) { err.printStackTrace(); }
Similar Threads
-
How to execute an External Program through Java program
By Java Tip in forum java.ioReplies: 0Last Post: 04-04-2008, 02:40 PM -
Windows Runtime Commands
By Java Tip in forum Java TipReplies: 0Last Post: 01-04-2008, 09:33 AM -
How to execute an External Program through Java program
By JavaBean in forum Java TipReplies: 0Last Post: 10-04-2007, 09:33 PM -
Need to write a program to execute a list of system commands
By mdthahir in forum New To JavaReplies: 2Last Post: 08-07-2007, 07:22 PM -
Need to write a program to execute a list of system commands
By mdthahir in forum NetworkingReplies: 1Last Post: 07-27-2007, 05:46 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks