cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1880
Views
0
Helpful
3
Replies

I am trying to create a batch file for running commands on my router

daniel.lind1198
Level 1
Level 1

I have the current script written to get me into the router.

"plink.exe" -ssh username@host -pw password < "input.txt"

The problem is once I am in the router I need it to enable and then enter another password in before I can execute commands. When I run this script it gets to the enable part but does not enter in the password. From what I am understanding in my "input.txt" I have the command "enable" which it executes, but if I put anything after that it runs it as a new command. After I enter in the "enable" command I need it to enter a password before executing more commands and I can't just put it right underneath "enable" in the "input.txt."

 

Is there a way to fix this?

 

Here is the input.txt I have set up

enable
password
config t
(I would like to enter different commands here once in configuration mode)

Thank you for your help.

3 Replies 3

balaji.bandi
Hall of Fame
Hall of Fame

is the user in privelage 15 if not use that priv 15 and test it.

 

 

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

I am in privelage 15. Also, after testing multiple things I have updated my question to better reflect my issue.

Thank you for trying to help.

input commands to send after login, so the enable should be done before it process inputs.

 

If you use privalage level 15 user, the enable password not required, based on your VTY config.

 

like below :

 

line vty 0 4

no login

privilege level 15

 

 

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help