|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Telnet in VB
Hi there.
I'm working on an application that has to execute a scripted secuence of commands in telnet, i've been using tst10 to enable the connection and execute the script here's my code: Code:
Private Function Conecta(Frase As String, archivo As String) As String
Dim NextBucle As Double
Dim PID As Double
Dim comando As String
comando = App.Path & "\tst10.exe /r:script.txt /o:output.txt"
PID = Shell(comando)
Do
'Delay (1)
NextBucle = VerificaProceso(PID)
Loop Until NextBucle = 0
PID = NextBucle
End Function
But everytime i run it on vb it opens the tst10 help file! if I run that very same command line on the dos prompt it runs flawlessly but not on the vb shell, why? Could someone please tell me why the shell is failing or where i could get another free scripting application for telnet? Please help me. thanks |
|
#2
|
|||
|
|||
|
Possibly because the switches to your command are using relative paths and who knows where your current directory is pointing? Just guessing.
__________________
====== Doug G ====== I didn't attend the funeral, but I sent a nice letter saying I approved of it. --Mark Twain |
|
#3
|
||||
|
||||
|
__________________
................... ASCII and ye shall receive .................. Knowledge is the only resource on earth that multiplies when shared Support the Shemzilla Project Powered by C# |
|
#4
|
|||
|
|||
|
Thanks everyone for your help, the program is now working.
![]() Someone told me that i could program the entire telnet sequence using Winsock, i've been doing some research about winsock and i have managed to make this: Code:
Private Sub Command1_Click()
TCPClient.RemoteHost = "10.103.8.15"
TCPClient.RemotePort = 23
TCPClient.Connect
TCPClient.GetData strData
TCPClient.SendData "root" & vbCrLf
But when i come to the part when i try to run either GetData or SendData i get the error WSAEWOULDBLOCK. Could somebody help me? I'm new to Sockets. Thanks ![]() |
|
#5
|
|||
|
|||
|
Quote:
try placing your TCPClient.GetData strData in the data arrival declarations ie. Code:
Private Sub TCPClient_DataArrival(ByVal bytesTotal As Long) TCPClient.GetData StrData, vbString MsgBox StrData End Sub |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > Telnet in VB |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|