Login | |
|
 |
Running telnet in script - 6/22/2005 8:57:17 AM
|
|
 |
|
| |
Archimedes
Posts: 1
Score: 0
Joined: 6/22/2005
From: USA
Status: offline
|
Morning, I'm trying to run telnet through vbs and the way I'm doing it is, I'm sure, ugly. WshShell.run("telnet server") oExec = WshShell.AppActivate("telnet") WScript.Sleep 5000 WshShell.SendKeys "user {enter}" WScript.Sleep 500 wshShell.SendKeys strPassword & "{enter}" WScript.Sleep 5000 WshShell.SendKeys "cd stuff {enter}" Is there a better way to run telnet? Second, when I enter the last command, it takes serveral hours to complete. How do i get the script to wait until this is done? I've tried several suggestions that I've seen in the forums but, alas, my PC is cursed. Do found = False Set procs = GetObject("winmgmts://./root/cimv2").execquery("select * from win32_process") For Each proc In procs If proc.name = "telnet.exe" Then found = True End If Loop Tells me i have no do before my loop If I do a .run(telnet,,true) the sendkeys do not go until I close telnet, which is silly. Any suggesion would be appreciated Thanks
|
|
| |
|
|
|
|
|