Would like to have some example code please for VB - WeOnlyDo Discussion board

Would like to have some example code please for VB (wodSSH / wodSSH.NET)

by Greg Maples, Friday, August 20, 2004, 03:38 (7425 days ago)

Need an example of vbscript code that would include examples of logon, sending command data to a ssh server and then receiving the data back -- nothing complicated, but I'm having trouble receiving the data. -- sending appears to be working just fine.

Thanks in advance.

Re: Would like to have some example code please fo

by wodSupport, Friday, August 20, 2004, 11:17 (7425 days ago) @ Greg Maples

Greg,

I will need your help with this. Basically, you need to initialize wodSSH and then do something like:

ssh.blocking = 1
ssh.hostname = something
ssh.login = something
ssh.password = something
ssh.connect
' at this point try to read all you can
' we are expecting command prompt
' try something like this
while ssh.dataready> 0
ssh.receive
end while

what could be causing trouble for you is that you don't read data that is initially sent by the server - so when you blindly send you need to receive initial data + your command response.

You could try also using Command property for your purpose. I don't know exactly what you need to do, but if you give me few hints I can try to make working VBS code for you.

Regards,
Kreso