How can a VB6 application that runs on a Windows XP machine, run a script on a Linux machine (Redhat 5.3) via SSH?
VB application should take the following arguments
- Linux login
- Linux password
- Script path
And then run the script path via SSH.
For example
ARG1 Login – root
ARG2 Password – USA123
ARG3 Script path - /var/tmp/task.pl
VB6 will run the script /var/tmp/task.pl on the Linux machine.
You can try using the “shell” function to create a command windows and then send ssh commands and parameters to it via the “sendKeys” function. However, this will be an error prone solution.
If you want a more permanent fix, take a look at this VB Library for SSH manipulation. You may find it of use. Here is a link to a sample project.
EDIT:
I don’t have the VB6 IDE so I reused a VBScript file I had created earlier. It can either be run as is or can be very easily converted to VB6 code.