Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I want to create a .bat to connect to a Switch Cisco 2900 via HyperTerminal and enable or disable a port. I try but i can´t transfer the password or comands via batch.
Somebody help me, please.
I try via telnet too, but i read that can´t use this commands via telnet, but if someone know how, tell me.
Thanks.

Scripting a hyperterminal session is not a very good choice, especially via a batch file.
You should use telnet or snmp, not hyperterminal. You can use just about any scripting language, but a batch script would be my last choice. My preference would be to use Perl.
"i read that can´t use this commands via telnet". Where did you read that nonsense? If the command can be executed from a hyperterminal or any other console session, it can certainly be executed in a telnet session.
If you want to use a batch file, I'll leave it up to IVO or M2Go to help you.

Hi folks,
I have never been able to script hyperterm. I don't think it's scriptable. {Is that a word?]
I would like to script telnet, but I don't habe a site that I can telnet to.
Does anyone have a sute available for telnet testing?
Don't put user/pw here.
=====================================
If at first you don't succeed, you're about average.M2Go

hi
scripting in telnet can be done in languages like Perl ,Python etc. For testing telnet, if you don't haave site to connect to for testing your telnet connections, you can set up your own telnet server and connect to your own machine.

If you want to use a Perl script, there are a variety of modules available that will make this very easy. Some of these modules are specifically designed to connect to cisco devices.
http://search.cpan.org/~jrogers/Net-Telnet-3.03/lib/Net/Telnet.pm
http://search.cpan.org/~joshua/Net-Telnet-Cisco-1.10/Cisco.pm
http://search.cpan.org/~kraken/Net-Telnet-Cisco-IOS-0.6beta/lib/Net/Telnet/Cisco/IOS.pmThere are others available, but those are the first ones to look at.

Thanks, Perl Script is amazing, i can connect automatic.
But i have a problem with the command 'set' in the switch Cisco 2900, appear "not config" in the help and when i try to execute display error. I connect with "enable" and enter in the "config term", but don´t work, some idea?
Help, again, please

Your description of the problem is not very clear. Can you post the script and the exact error message? Posting code in this forum is a real pain to the point of being a joke beacuse the formating gets screwed up. If you want, you can email it to me in addition to posting it here.
I don't have a 2900 to test, but the 7000 switch I connect to doesn't have "config term", instead it has "config network". What IOS version are you using?
When I get into work in a few hours, I'll see if I can connect to one of our 3500 switches. They should have the same or close to the same IOS as the 2900's.

I try to enable or disable a port specific.
Really the scripts is not the problem, is the command of Switch.In documentation of Cisco you can do it with command: "set port enable X/X" or "set port disable X/X", but when i try to execute it in Switch, it displays something like this:
XXXX#set port enable 0/10
^
% Invalid input detected at '^' marker.When i see the help, display this:
set Set system parameter (not config)
What can i do?, exist other command to do what i want?
Thanks

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |