View Single Post
  #2  
Old 09-29-2005, 02:33 AM
erltorres erltorres is offline
Registered User
 
Join Date: Sep 2005
Posts: 4
Hi,
I think that you want a file .txt with devices information (ip, name, etc) to send telnet to them and when you are loggen in it send commandS.

I use 2 file .txt to do this in a cisco router,
For example:

Dim fs0
Dim fs1
Dim ts0
Dim ts1
Const ForReading = 1
Dim IP
Dim LINEA

Set fs0 = CreateObject("Scripting.FileSystemObject")
Set ts0 = fS0.OpenTextFile("C:\devices.txt", ForReading)


Do While ts0.AtEndOfStream <> True
'****Use the split command if you have mre information in the line than the IP******
IP = ts0.ReadLine
crt.Screen.Send "telnet " & IP & " & VbCr
'****now you can log in the device...***
Set fs1 = CreateObject("Scripting.FileSystemObject")
Set ts1 = fS1.OpenTextFile("C:\comands.txt", ForReading)
Do While ts1.AtEndOfStream <> True
LINEA = ts1.ReadLine
crt.Screen.Send LINEA & VbCr
crt.Screen.WaitforString "#"
Loop
ts1.Close()
Loop
ts0.Close()

Bye.
Reply With Quote