Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

SendKeys & AppActivate

1 view
Skip to first unread message

Unknown

unread,
Jan 6, 2003, 10:22:43 AM1/6/03
to
I try to write a script to open a "telnet" session without using the keyboard ( the script must give the user and the password) but no result !
I am a beginer and I try to use "SendKeys" and "AppActivate". May be is not the good solution ! Can anybody help me ?
Thanks !

**********************************************************************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...

Tom Lavedas

unread,
Jan 6, 2003, 4:28:07 PM1/6/03
to
Something like this should work ok in NT/2000/XP ...

sIP = "123.45.67.89"
sPortNo = "123"
sUserID= "username"
sPassword = InputBox("Password")

With CreateObject("Wscript.Shell")
.Run "%comspec% /k title Telnet & telnet " '& sIP & " " & sPortNo,
1, false
While not .AppActivate("Telnet") : Wscript.Sleep 100 : Wend
.SendKeys sUserID & "{Enter}"
.SendKeys sPassword & "{Enter}"

End With

This approach will NOT work with Win 95/98/ME and there is no good way
to get any information back from the telnet session using the Windows
telnet client. I once worked out a kludge using the system clipboard
for use with 95/98/ME, but I can't recommend it.

I have seen references to 'scriptable' telnet clients out there, but I
don't have a reference.

Tom Lavedas
===========

Catalin Cernahoschi (catalin.c...@bcr.ro) wrote in message news:<OHDu2dZtCHA.2484@TK2MSFTNGP10>...

Curtis Anderson

unread,
Jan 6, 2003, 6:04:09 PM1/6/03
to
Tom Lavedas <tlav...@hotmail.com> uttered:

> I have seen references to 'scriptable' telnet clients out there, but I
> don't have a reference.
>
> Tom Lavedas

No problem; I do. :-)
http://sourceforge.net/projects/telscript

I haven't played with it but IIRC Alex K was messing about a bit with it -
are you around today Alex? I can't vouch for how well or how badly it
performs.


0 new messages