![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | telnet Hi, How do I close the telnet session? Dim objShell Dim strUsername Dim strPassword strUsername = "john" strPassword = "johnpass" Set objShell=CreateObject("wscript.shell") objShell.Run "Telnet " & "192.168.0.4" WScript.Sleep 50 objShell.AppActivate "Telnet " & strComputer objShell.SendKeys strUsername & "~" WScript.Sleep 50 objShell.SendKeys strPassword & "~" WScript.Sleep 50 objShell.SendKeys "su root" & "~" WScript.Sleep 50 objShell.SendKeys "rootpass" & "~" objShell.SendKeys "exit" & "~" objShell.quit quit??? Thank you all |
My System Specs![]() |
| | #2 (permalink) |
| | Re: telnet "Bre-x" <cholotron@xxxxxx> wrote in message news:O3jKUFX3JHA.5816@xxxxxx Quote: > Hi, > How do I close the telnet session? > > > Dim objShell > Dim strUsername > Dim strPassword > > strUsername = "john" > strPassword = "johnpass" > > Set objShell=CreateObject("wscript.shell") > objShell.Run "Telnet " & "192.168.0.4" > WScript.Sleep 50 > objShell.AppActivate "Telnet " & strComputer > > objShell.SendKeys strUsername & "~" > WScript.Sleep 50 > objShell.SendKeys strPassword & "~" > WScript.Sleep 50 > objShell.SendKeys "su root" & "~" > WScript.Sleep 50 > objShell.SendKeys "rootpass" & "~" > > objShell.SendKeys "exit" & "~" > objShell.quit > > quit??? > > Thank you all > -- Richard Mueller MVP Directory Services Hilltop Lab - http://www.rlmueller.net -- |
My System Specs![]() |
| | #3 (permalink) |
| | Re: telnet I have this script that works ok so far, when the script send the command: "./john_email.sh" & "~", it is imposible to know how log it will take to run. is there a way to "wait" for the command to finish then send the next command?. Thank you All Dim objShell Set objShell=CreateObject("wscript.shell") 'Connect to Intranet objShell.Run "Telnet " & "192.168.0.4" WScript.Sleep 50 objShell.AppActivate "Telnet 192.168.0.4" 'Send telnet User objShell.SendKeys "john" & "~" WScript.Sleep 50 objShell.SendKeys "john_pass" & "~" WScript.Sleep 500 'Send root User objShell.SendKeys "su root" & "~" WScript.Sleep 5 objShell.SendKeys "root_pass" & "~" WScript.Sleep 50 objShell.SendKeys "cd /data/webserver/cron" & "~" WScript.Sleep 50 objShell.SendKeys "./john_email.sh" & "~" WScript.Sleep 50 objShell.SendKeys "exit" & "~" objShell.SendKeys "exit" & "~" objShell.SendKeys "quit" & "~" "Bre-x" <cholotron@xxxxxx> wrote in message news:O3jKUFX3JHA.5816@xxxxxx Quote: > Hi, > How do I close the telnet session? > > > Dim objShell > Dim strUsername > Dim strPassword > > strUsername = "john" > strPassword = "johnpass" > > Set objShell=CreateObject("wscript.shell") > objShell.Run "Telnet " & "192.168.0.4" > WScript.Sleep 50 > objShell.AppActivate "Telnet " & strComputer > > objShell.SendKeys strUsername & "~" > WScript.Sleep 50 > objShell.SendKeys strPassword & "~" > WScript.Sleep 50 > objShell.SendKeys "su root" & "~" > WScript.Sleep 50 > objShell.SendKeys "rootpass" & "~" > > objShell.SendKeys "exit" & "~" > objShell.quit > > quit??? > > Thank you all > |
My System Specs![]() |
| | #4 (permalink) |
| | Re: telnet From the downloadable help file script56.chm: object.Run(strCommand, [intWindowStyle], [bWaitOnReturn]) Note that your method of using the SendKeys command is making your script unreliable. There are several events that can and will disrupt the SendKeys method, which is why it should be used only when everything else fails. A far more reliable method is to use a telnet substitute, sc.exe, which does not suffer from some of the limitations of telnet, and to embed it in a batch file. You can get sc.exe from here: http://www.securityfocus.com/data/tools/nc11nt.zip. "Bre-x" <cholotron@xxxxxx> wrote in message news:eY$Ah1h3JHA.4416@xxxxxx Quote: >I have this script that works ok so far, when the script send the command: >"./john_email.sh" & "~", it is imposible to know how log it will take to >run. > is there a way to "wait" for the command to finish then send the next > command?. > > Thank you All > > Dim objShell > Set objShell=CreateObject("wscript.shell") > > 'Connect to Intranet > objShell.Run "Telnet " & "192.168.0.4" > WScript.Sleep 50 > objShell.AppActivate "Telnet 192.168.0.4" > > 'Send telnet User > objShell.SendKeys "john" & "~" > WScript.Sleep 50 > objShell.SendKeys "john_pass" & "~" > WScript.Sleep 500 > > 'Send root User > objShell.SendKeys "su root" & "~" > WScript.Sleep 5 > > objShell.SendKeys "root_pass" & "~" > WScript.Sleep 50 > > objShell.SendKeys "cd /data/webserver/cron" & "~" > WScript.Sleep 50 > > objShell.SendKeys "./john_email.sh" & "~" > WScript.Sleep 50 > > objShell.SendKeys "exit" & "~" > objShell.SendKeys "exit" & "~" > objShell.SendKeys "quit" & "~" > > > > > "Bre-x" <cholotron@xxxxxx> wrote in message > news:O3jKUFX3JHA.5816@xxxxxx Quote: >> Hi, >> How do I close the telnet session? >> >> >> Dim objShell >> Dim strUsername >> Dim strPassword >> >> strUsername = "john" >> strPassword = "johnpass" >> >> Set objShell=CreateObject("wscript.shell") >> objShell.Run "Telnet " & "192.168.0.4" >> WScript.Sleep 50 >> objShell.AppActivate "Telnet " & strComputer >> >> objShell.SendKeys strUsername & "~" >> WScript.Sleep 50 >> objShell.SendKeys strPassword & "~" >> WScript.Sleep 50 >> objShell.SendKeys "su root" & "~" >> WScript.Sleep 50 >> objShell.SendKeys "rootpass" & "~" >> >> objShell.SendKeys "exit" & "~" >> objShell.quit >> >> quit??? >> >> Thank you all >> > |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| telnet | General Discussion | |||
| Telnet | Vista General | |||
| Where did Telnet go? | Vista General | |||
| Telnet | Vista networking & sharing | |||
| Telnet | Vista General | |||