dula Posted February 15, 2008 Posted February 15, 2008 how to convert this vbs to au3 ?thx set sh=WScript.CreateObject("WScript.Shell") sh.run "Telnet samsung.router" WScript.Sleep 600 sh.SendKeys "root"&vbcr WScript.Sleep 500 sh.SendKeys "admin"&vbcr WScript.Sleep 500 sh.SendKeys "killall pppd"&vbcr Wscript.Sleep 1000 sh.SendKeys "pppd call pppoe1"&vbcr Wscript.Sleep 500 sh.SendKeys "exit 0"&vbcr Wscript.Sleep 500 sh.SendKeys "Quit"&vbcr
Zedna Posted February 15, 2008 Posted February 15, 2008 Look at AutoIt's functions: Run Sleep Send Resources UDF ResourcesEx UDF AutoIt Forum Search
Zedna Posted February 15, 2008 Posted February 15, 2008 Run("Telnet.exe samsung.router") Sleep(600) Send("root" & @CRLF) ... Resources UDF ResourcesEx UDF AutoIt Forum Search
McGod Posted February 15, 2008 Posted February 15, 2008 Not an easy as you might think Zedna, Since he's using a DOS command prompt so he would telnet to his router, send root via telnet. Try uses TCP() functions, they would be able to implement the Telnet. [indent][center][u]Formerly Chip[/u][/center]~UDFs~[/indent][u]IRC.au3 - Allows you to connect to IRC ServersINetCon.au3 - Connects/Disconnects/Check Status of InternetHardware Key - Creates a unique hardware hashScriptComm - Allows you to communicate between scripts using WM_COPYDATA[/u][indent]~Programs~[/indent][indent]SimonAu3ForumsIRC Bot~Web Site~Web Autoit Example[/indent][indent][b][/b][/indent][u][/u]
Zedna Posted February 15, 2008 Posted February 15, 2008 Not an easy as you might think Zedna, Since he's using a DOS command prompt so he would telnet to his router, send root via telnet.Try uses TCP() functions, they would be able to implement the Telnet.I have just translated given code.For Telnet manipulation look here Resources UDF ResourcesEx UDF AutoIt Forum Search
dula Posted February 15, 2008 Author Posted February 15, 2008 not works please help me ; ---------------------------------------------------------------------------- ; ; VBScript to AutoIt Converter v0.4 ; ; ---------------------------------------------------------------------------- ;VA $sh=WScript.ObjCreate("WScript.Shell") $sh.run ("Telnet samsung.router 30023") ;VA WScript.Sleep 600 $sh.SendKeys ("root"&vbcr) ;VA WScript.Sleep 500 $sh.SendKeys ("banana"&vbcr) ;VA WScript.Sleep 500 $sh.SendKeys ("/etc/init.d/daily_reconnect.$sh 1"&vbcr) $sh.SendKeys (""&vbcr)
Zedna Posted February 15, 2008 Posted February 15, 2008 correction: Send("root{Enter}") Resources UDF ResourcesEx UDF AutoIt Forum Search
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now