Capturing text from Telnet Session

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
craig eades
Newbie
Posts: 4
Joined: Wed Sep 01, 2004 10:53 pm

Capturing text from Telnet Session

Post by craig eades » Tue Feb 28, 2006 10:25 pm

I have a device which is managed via telnet. I'm trying to get status information out of telnet to verify state information.

I'm unable to do so using GetWindowText (returns 0).

I start by executing Telnet.exe and then using send to send 'open '. After that I send key strokes to get to the information I need.

Any tips?

Craig

:?:

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Tue Feb 28, 2006 11:42 pm

I have not used Telnet for long time, but I seem to recall the ability to create a log file. If that is possible, then you should be able to read and parse the log file.

==============================
Here is what I found about Telnet logging:

Microsoft Windows 3.11, 95, 98, ME users
In the telnet window click Terminal drop down and select the option Start Logging. This will open a new window on where you can save the log. Once the log location has been specified logging is enabled.

Other Windows users
With the default telnet client included with other Microsoft Windows users such as Windows 2000 and Windows XP users this program does not have the ability to log a telnet session.
=============================

If you need a telnet client with these capabilities you might wand to download a third-party program such as CRT, available at http://www.computerhope.com/download/sh ... tcrt31.exe
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

User avatar
Marcus Tettmar
Site Admin
Posts: 7378
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Wed Mar 01, 2006 7:57 am

Or just copy and paste. Most telnet clients let you copy to the clipboard. You could highlight entire screen then copy to clipboard and then use GetClipBoard to get screen contents into a variable.

If you are using the built in Windows Telnet client, the following highlights the entire screen:

SetFocus>telnet.exe*
Press ALT
Send> es
Release ALT

To copy you then just press Enter:

Press Enter

So now you can do:

Wait>1
GetClipBoard>telnetscreen

telnetscreen variable now contains the text on the telnet screen and you can parse it or check for the existance of certain text, or whatever you need to do.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

kevin1411
Newbie
Posts: 1
Joined: Mon Feb 26, 2018 1:47 pm

Re: Capturing text from Telnet Session

Post by kevin1411 » Mon Feb 26, 2018 1:52 pm

Thanx for providing the detail to fix the error. but here some guidelines to fix the error with some easy steps follow the link.
https://techfries.co/install-telnet-client/

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts