trouble with execute command at cmd in java -


i want reboot adsl modem , code . code going until reach login section , must enter username(admin) , press enter . problem /c not work (/c admin). how can write admin , press enter ?

public static void main(string[] args) throws ioexception {      string tel = "telnet 192.168.1.1 23";     string user = "admin";     string pass = "admin";     string reboot = "reboot";     string command = "cmd /c start cmd.exe /c"+tel;     process child = runtime.getruntime().exec(command);   } 

my mean of login section picture:

http://s1.postimg.org/eb74ryahb/untitledsd.png

process child = runtime.getruntime().exec(command); writer writer = new java.io.outputstreamwriter(child.getoutputstream()); writer.append("string"); writer.flush(); 

after read input again see if asks password or whatever does.


Comments

Popular posts from this blog

jquery - How do you format the date used in the popover widget title of FullCalendar? -

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -