Telnet script tool




















You have to tell it what the server is going to say. I can't help you with that since I don't have access to it. Emission des messages 2. Acces a la base de donnees 3. Fin de session Entrer le choix : 3. You do not have the required permissions to view the files attached to this post. Last edited by nasr on Tue Jun 02, am, edited 1 time in total.

I await your answers. Use python telnetlib module. An example is here stackoverflow. Add a comment. Active Oldest Votes. Silly example echo password; echo "show ip route"; sleep 1; echo "quit" telnet myrouter This basicallly retrieves the routing table of a Cisco router.

Improve this answer. Vatine Vatine WakanTanka Forcing the echos and sleeps to run in a sub-shell, sharing a stdout and actually have the sleep pause the output before the "quit" command is echoed, to allow the full routing table to print, before the connection dies.

Brian Agnew Brian Agnew k 36 36 gold badges silver badges bronze badges. Expect implementations are also available in other languages, like Perl's Expect.

The Expect distribution includes a script called autoexpect which will generate an expect script by looking at a session. The generated script is simple enough to tweak. Windows is not supported. Excellent answer, telnet wasn't working but piping it through nc instead worked.

C'mon people, when you downvote, tell me why especially years after the fact — KevinDTimm. Your answer could simply have been a comment in Vatine's answer. Or an edit to his. There was no need to post an entirely new answer when you mention "same format as vatine shows". In SO, getting the best answer out is better than having a lot of answers cross referencing each other, or so I believe. BTW, I didn't downvote. This vbs script reloads a cisco switch, make sure telnet is installed on windows.

CreateObject "WScript. Shell" oShell. Run "telnet" WScript. Sleep oShell. Sendkeys "open Arjan Keij Arjan Keij 81 1 1 silver badge 1 1 bronze badge.

Only solution that worked on Windows for me tried the Linuxy like solutions on Cygwin on Windows, none of them worked for me — ericcurtin. You can use it as follows: perl sendcommand. Tim Cooper k 36 36 gold badges silver badges bronze badges. I guess it's obscure compared to Perl or Python, but it's actually fairly well known and respected in scripting circles. ActiveState has a reputation for building solid stuff.

The community edition is gratis. It's not clear to me whether the community edition is allowed to be used in a commercial setting. It is billed as being "ideal for community developers or open source projects that are not business or mission-critical", but I can't see where it says it is limited to community developers or open source projects.

All I can tell for sure is that the community edition isn't entitled to "professional" support - you have to rely on the forums instead. I know this thread is a few years old but i used tera term years ago to reconfigure all of a companies printers using it's built in macro language. Sign up to join this community. The best answers are voted up and rise to the top. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams?

Learn more. Tool to script telnet connections, commands, etc Ask Question. Asked 4 years, 5 months ago. Active 2 years, 1 month ago. Viewed 4k times. Runs on Windows, including Windows Server If not PowerShell, needs robust scripting language capabilities Thus far I've come across various random "script it with VB" or "script it with this obscure scripting language [that would require all this other software to be installed]".

It's clear that many people are looking for something similar, I've come across a lot of recomendations and discussions, and they are grossly over-complicated, or can't see the forest for the trees. Automating Telnet with PowerShell Automating Telnet Script Is it possible to use a batch file to establish a telnet session, send a command and have the output written to a file?

Improve this question. Windows 10 has a linux-like command shell available, but that's a brand-new feature implemented in the past couple of months. It's not guaranteed to be on a Windows box. Add a comment. Active Oldest Votes. Improve this answer.



0コメント

  • 1000 / 1000