Results 1 to 4 of 4
- 08-29-2013, 09:30 AM #1
Member
- Join Date
- Aug 2013
- Posts
- 1
- Rep Power
- 0
how to run a superuser commands via java program.?
hi all,
i want to run the superuser commands via java program.
Java Code:public static void main(String a[]) throws IOException { try { Process p = Runtime.getRuntime().exec("ifconfig -a"); BufferedReader in = new BufferedReader( new InputStreamReader(p.getInputStream())); String line = null; while ((line = in.readLine()) != null) { System.out.println(line); } } catch (IOException e) { e.printStackTrace(); } }
i am running these things from IDE.
Anybody know the way to solve this one.?!!
Regards,
cooldharma06.Last edited by cooldharma06; 08-29-2013 at 09:51 AM. Reason: Adding additional info
- 08-29-2013, 12:10 PM #2
Just a guy
- Join Date
- Jun 2013
- Location
- Netherlands
- Posts
- 5,114
- Rep Power
- 13
Re: how to run a superuser commands via java program.?
Question about Runtime.exec: check
Code uses single String version: check
Automated reply: When Runtime.exec() won't - JavaWorld"Syntactic sugar causes cancer of the semicolon." -- Alan Perlis
- 08-29-2013, 12:38 PM #3
Re: how to run a superuser commands via java program.?
If you're forever cleaning cobwebs, it's time to get rid of the spiders.
- 08-29-2013, 12:53 PM #4
Just a guy
- Join Date
- Jun 2013
- Location
- Netherlands
- Posts
- 5,114
- Rep Power
- 13
Similar Threads
-
Running SVN commands through java program
By testkiranpgp in forum New To JavaReplies: 3Last Post: 04-13-2012, 01:41 PM -
java program for running the command prompt commands
By leoanto in forum Advanced JavaReplies: 2Last Post: 03-26-2011, 04:57 PM -
What can cause of java program to suddenly stop reading commands?
By ryuzog in forum New To JavaReplies: 25Last Post: 11-04-2010, 05:26 PM -
Need Help to Execute the commands from Java Program
By Anjaneyulu in forum Advanced JavaReplies: 7Last Post: 02-24-2010, 03:35 PM -
Execute the commands in Jsp Program
By swetha_2008 in forum JavaServer Pages (JSP) and JSTLReplies: 0Last Post: 12-17-2008, 07:04 AM
Bookmarks