Automating a script - WeOnlyDo Discussion board

Automating a script (wodSSH / wodSSH.NET)

by Shawn, Tuesday, October 23, 2007, 03:30 (6040 days ago)

This issue is found using VB6. I have recently purchased the ssh control and I am struggling to get it to do exactly what I want. Using your example as a base, I have created this logon on code:

Ssh.HostName = ip
Ssh.Login = user
Ssh.Password = pw
Ssh.Protocol = SSH2
Ssh.Prompt = Password:
Ssh.Blocking = True
AddToList Connecting... & vbCrLf
Ssh.Connect

Running just this code and I am prompted to enter the password. By adding this command

ssh.Send PW , 0

and I am connected to the device. I setup a button that will send the following command

Ssh.send host info -sf -n 20 -i & vbLf

If I push one button to connect and then the second button to send the command everything works as expected and the results are displayed in the results textbox.

The problem is that I want this to execute entirely in one go. When I run the code

Ssh.HostName = ip
Ssh.Login = user
Ssh.Password = pw
Ssh.Protocol = SSH2
Ssh.Prompt = Password:
Ssh.Blocking = True
AddToList Connecting... & vbCrLf
Ssh.Connect
Send PW , 0
Ssh.send host info -sf -n 20 -i & vbLf

The results do not appear to be written to the received buffer. I have tried putting a time delay between the send functions (uses a timer control) but is does not help.

Thank you,
Shawn


Complete thread: