Telnet Using VB... capturing...

xBox
09-07-2003, 01:59 AM
Hi All,

I'm passing telnet commands using sendkeys.
I'm Attaching following code which I was coded. This is working fine.

My Question is how do I capture the response from telnet after passing a command.

Below example, passing the servername and the Username... then I have to capture the response,


Dim lReturn As Variant
Dim strTemp,strUName,strServer

strUName="TestU"
strServer="ITCat01"

strTemp = "Telnet " & strServer

lReturn = Shell(strTemp, vbNormalFocus)
AppActivate lReturn


SendKeys strUname & "{ENTER}"

DeX
09-07-2003, 03:52 AM
I don't think you can capture output direct from the command window - at least not without outputting to a file but I'm not sure that would work in telnet. You could at least try something like this:

strTemp = "Telnet " & strServer & " > output.txt"

Anyway I think the best way is to learn how to implement telnet commands in your own program using winsock: http://www.vbip.com/winsock/winsock_terminal.asp

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum