Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Read Text File, Pass to script

Status
Not open for further replies.

NetNodeMan

Technical User
Mar 30, 2005
65
IE
Hi all.

I have a script which telnets to a switch and enter in IP information and then does a "sh run" on that switch. this works perfect for one switch. However, if I want it to run for 10 switches I need to hard code the information.

I have searched on here but I've been even more confused by what I've found. Can anyone help me with this? I want to read in an IP from a text file and pass it to the telnet session. Can anyone help? Please post code if you have it because it's not my script and I am completely clueless when it comes to scripting.
 
[blue] Have Fun! [/blue]

Const ForReading = 1
Const ForWriting = 2
Const ForAppending = 8

Set objFSO = CreateObject("Scripting.FileSystemObject")

Set objInputFile = objfso_OpenTextFile("InputFile.txt",ForReading)
Do While objInputFile.AtEndOfStream <> True
strIPAddress = trim(objInputFile.readline)
'Put your code here
loop

objInputFile.Close

[blue] MORE INFO!!! [/blue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top