Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old October 10th, 2005, 08:17 PM
Paidblow Paidblow is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 37 Paidblow User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 h 4 m 3 sec
Reputation Power: 4
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

Reply With Quote
  #2  
Old October 10th, 2005, 11:03 PM
Doug G Doug G is offline
Grumpier Old Moderator
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Sep 2003
Posts: 10,143 Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 23 h 19 m 36 sec
Reputation Power: 181
Possibly because the switches to your command are using relative paths and who knows where your current directory is pointing? Just guessing.
Comments on this post
Paidblow agrees!
__________________
======
Doug G
======
I didn't attend the funeral, but I sent a nice letter saying I approved of it. --Mark Twain

Reply With Quote
  #3  
Old October 10th, 2005, 11:16 PM
lewy's Avatar
lewy lewy is offline
Alter Ego Wizard
ASP Free Specialist (4000 - 4499 posts)
 
Join Date: Jun 2004
Location: Edinburg Tx
Posts: 4,381 lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)lewy User rank is General 8th Grade (Above 100000 Reputation Level)  Folding Points: 1009 Folding Title: Novice Folder
Time spent in forums: 1 Month 1 Week 1 Day 23 h 7 m 43 sec
Reputation Power: 1488
Comments on this post
Paidblow agrees: Thanks but the Dart software aint free...
__________________
................... ASCII and ye shall receive ..................
Knowledge is the only resource on earth that multiplies when shared


Support the Shemzilla Project
Powered by C#

Reply With Quote
  #4  
Old October 13th, 2005, 02:15 PM
Paidblow Paidblow is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 37 Paidblow User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 h 4 m 3 sec
Reputation Power: 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

Reply With Quote
  #5  
Old October 14th, 2005, 04:06 PM
Alias-Zero Alias-Zero is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2005
Location: localhost
Posts: 40 Alias-Zero User rank is Lance Corporal (50 - 100 Reputation Level)Alias-Zero User rank is Lance Corporal (50 - 100 Reputation Level)Alias-Zero User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 14 h 44 m 12 sec
Reputation Power: 4
Send a message via ICQ to Alias-Zero Send a message via AIM to Alias-Zero Send a message via MSN to Alias-Zero Send a message via Yahoo to Alias-Zero
Quote:
Originally Posted by Paidblow
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



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

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > Telnet in VB


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT