cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
487
Views
14
Helpful
2
Replies

Passing commands to a device via a batch file

vtodd
Level 1
Level 1

I am trying to set up a Local Director so that I can have someone run a batch file to run the commands required to remove the server from the LD, without needing to know what the commands are. I want to make this as easy for that person as possible.

What I would like to know is if there is a way to get the following to work:

In a batch file (or similar)

telnet X.X.X.X

password

en

password

conf t

oos real server

All I can get this to do is open a telnet session, then it waits for the password.

2 Replies 2

smalkeric
Level 6
Level 6

Normal batch file will not help you in this case. You will need intelligent scripting languages like EXPECT and TCL/TK.

nyurkovich
Level 1
Level 1

Batch files will not execute the anything past the telnet command.

i.e.

password

en

password

conf t

oos real server

A session is prevoked by this command and regular batch commands will not work. Basically the commands within your batch file cannot be used as input during a Telnet session. Once your telnet session is complete the batch file will then try and execute.

password

en

password

conf t

oos real server

on the command line

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: