Tuan-Anh Tran

BAT script to execute commands on remote Unix machine with PuTTY

Posted on December 13, 2014  •  1 minutes  • 66 words
putty -i private_key.ppk remoteuser@remotehost -m local_script.bat

{: .bash}

In the example above, I use public key authentication to authenticate and then execute the commands inside local_script.bat on the remote machine. Alternatively, you can use plink which is basically putty without the GUI part. All other options are basically the same.

You can also use password for authentication, just replace -i option with -pw and your password.

Follow me

Here's where I hang out in social media