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
Capturing text from Telnet Session
Moderators: Dorian (MJT support), JRL
-
- Newbie
- Posts: 4
- Joined: Wed Sep 01, 2004 10:53 pm
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
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
==============================
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!
Bob
A humble man and PROUD of it!
- Marcus Tettmar
- Site Admin
- Posts: 7378
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
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.
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?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
Re: Capturing text from Telnet Session
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/
https://techfries.co/install-telnet-client/