PDA

View Full Version : SSH via VBA and querying return stream



ChloeRadshaw
11-15-2008, 07:39 AM
Does anyone know if you can use VBA to connect to a unix machine (either through ssh / telnet), then run a command and be able to read the input back?

This is definitely doable using Ruby or Java - I ve read how to do a shellAndWait but have not seen anyone been able to capture the response from the process :(

Am I missing something obvious here?

Kenneth Hobs
11-15-2008, 08:46 AM
Not sure what you want to return. You can look at the help for Shell.

Most likley, you will want to use ShellExecute or ShellWait. For these see:
http://www.mvps.org/access/api/api0004.htm
http://support.microsoft.com/kb/238245

ChloeRadshaw
11-15-2008, 10:18 AM
Thanks

Ultimately I need to run a process on a unix machine

So I can either use telnet or ssh - I ve read that telnet does not allow you to read from stdout so you are forced to use ssh.

Have you used either of these in the past with any success?

Kenneth Hobs
11-15-2008, 10:24 AM
I haven't used Unix since the early 90's. I have used all 3 commands to shell. It is easy enough to try each one.

ChloeRadshaw
11-15-2008, 11:56 AM
Can you please give an example of using ssh please to connect to machine and do a 'ls' and read the rsponse?

I ve been trying for a couple of days solid without any joy and the alternatives are setting up a web server on the unix machine and then using web queries to query

This obviously sucks big time so any help would be most appreciated

I did try the shell command but it prompts you for a password and I cannot get the results into VBA

Would web queries be the way here?