VBS script to use putty/plink to login to Unix - run command - retrieve answer into variable
Posted on 2014-09-11
I need to create a VBS script do the following - all in the background and not verbos:
1. Call putty/plink and ssh to a Unix (or Linux) server with user ID and password.
2. Run a specific command to find out if the system is primary or backup (for failover)
3. Feed the answer into a variable and then rename a file to something else if the variable equals one server or the other.
I am familiar enough with VB at this point to know what to do after I get the value in the variable but I have no idea how to log in to a Unix/Linux server via ssh from a windows system, run a unix command, get retrieve the command result and bring it back.
Any help would be great. I am not opposed to using something other than VB - it's just that I'm more familiar with that than anything else.