cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
5431
Views
0
Helpful
2
Replies

How to put the "Enter" key in a script

Hi,

I want to make a short script to delete multiple usernames from a 1921 router.

The problem is that when you put the command I get the below message:

" no username Sally privilege 15 secret 5 $1$kf4z$8o3bB56rLRXMnvmHTYiEP.

This operation will remove all username related configurations with same name.Do you want to continue? [confirm] "

Each time I have to hit the Enter key to delete the user, it;s frustrating.

Is there a special character I can include in the notepad script to substitute this "enter key" ?

I have 5 users one after the other that I need to delete on many routers.

Many thanks,

Andrei

2 Replies 2

Marvin Rhoads
Hall of Fame
Hall of Fame

Those are known as Interactive commands. There is a special syntax for them, documented here:

http://www.cisco.com/c/en/us/td/docs/net_mgmt/prime/infrastructure/3-1/user/guide/pi_ug/config-temp.html#26075

I don't have a PI server in front of me to verify, but you should be able to use something like:

#INTERACTIVE
no username sally<IQ>This operation will remove all username related configurations with same name.Do you want to continue? [confirm]<R>y
#ENDS_INTERACTIVE

nbacon001
Level 1
Level 1

Old post, but in case anyone else comes across this problem in v3.1, here is the correct syntax:

 

#INTERACTIVE
no username sally<IQ>[confirm]<R>y
#ENDS_INTERACTIVE

Review Cisco Networking for a $25 gift card