View Single Post
  #3  
Old 05-11-2013, 01:51 PM
kurtmanzano kurtmanzano is offline
Registered User
 
Join Date: May 2013
Posts: 6
working but have question

got this working

with this code

#$language = "VBScript"
#$interface = "1.0"

Sub Main
On Error Resume Next
' Open the hosts file
Dim fso, f
Set fso = CreateObject("Scripting.FileSystemObject")
Set fileHosts = fso.OpenTextFile("d:\ip.txt", 1)
szHost = fileHosts.ReadLine
Do While len(szHost) > 4
crt.session.connect("/telnet " & szHost)
crt.Screen.Synchronous = True
crt.Screen.Send VbCr
' Commands
crt.Screen.WaitForString "Password:"
crt.Screen.Send "password1234" & chr(13)
crt.Screen.WaitForString "router> "

' START WRITING FILE
Set objFSO = CreateObject("Scripting.FileSystemObject")
Const ForAppending = 8
' Create a new file (or overwrite an existing one)
Set objStream = objFSO.OpenTextFile( _
"D:\MyDataFile.txt", _
ForAppending, _
True)
objStream.WriteLine crt.Session.RemoteAddress
' END WRITING FILE
' Commands
crt.Screen.Send "exit" & chr(13)
szHost = fileHosts.ReadLine
Loop
End Sub

But i have a question is it possible since i connect from an ip list file (ip.txt) to make this multi threaded like run 1st five ips from the text file, then next five from text file? > running on tabs

thanks
Reply With Quote