edumanilha Posted February 14, 2020 Share Posted February 14, 2020 Hello, I'm trying to use plink, to make SSH connections and sent pre configured list of commands to automate linux maintenance...But I can't even start it...I'm using this code, used well with putty: $CMD = @ScriptDir & "\Dados\putty.exe -ssh -pw PASSWORD USER@" & $IPVAR $iPID = Run(@ComSpec & " /c " & $CMD, @WindowsDir, @SW_ENABLE) ProcessClose("$iPID") WinActivate("root@") I tried just change the exe name, but the plink manual said it must be on actual folder ou you must create a path! The path will not be practical, because other people will use, or I could run some command to create the path every time, and store this path as a var? I tried also put the exe in the same folder as the autoit exe, without success... When I try to send the commands what the best aproach? plink have command files like putty? Whats the best way to send commands with hidden window? Thanks guys! Link to comment Share on other sites More sharing options...
Marc Posted February 14, 2020 Share Posted February 14, 2020 For sending simple commands (never had the need to let a script run on the remote machines), I use RunWait(@ComSpec & ' /c "c:\Program Files\putty\plink.exe" -ssh root@SERVERNAME -pw PASSWORD halt', @SystemDir) which will send the "halt" command to the server. You'll find much more useful input here: edumanilha 1 Any of my own codes posted on the forum are free for use by others without any restriction of any kind. (WTFPL) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now