Jump to content

script to run putty.


Recommended Posts

RunWait(@ComSpec & ' /c "c:\Program Files\putty\plink.exe" -ssh root@SERVERNAME -pw PASSWORD halt', @SystemDir)

this would connect with putty to the server SERVERNAME as root, usind the password PASSWORD and send a "halt" command to the machine.

Or you could simulate using the real putty.exe and simulate keystrokes:

Func putty($server, $passwort, $command)
    Run("c:\Program Files\putty\putty.exe" & " " & $server)

    WinWaitActive($server)

    Sleep(200)
    Send("root")
    Send("{ENTER}")
    Sleep(300)
    Send($passwort)
    Send("{ENTER}")
    Sleep(800)
    Send($command)
    Sleep(200)
    Send("{ENTER}")
EndFunc   ;==>putty

 

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

It appears you haven't learned anything since the last time you created similar topics.  How is this current topic any different than the one below? 

You still can't figure out how to run Putty from a script?  Really?!?

You have shown absolutely NO effort of your own in this or the last 2 topics that you created on this subject.  In all cases, people have pointed you in the right direction.  Your response has basically been thanks that's great but can you pick me up and carry me there.  Why should anyone waste their time trying to help you if you repeatedly show no effort of your own?  Where are any of your attempts?  What have you actually tried that didn't work?

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...