PuTTY SSH execute remote command

enter image description herePutty.exe -ssh user@192.168.1.1 -pw password -m C:\local\file\containing_command Et voilà !
simple and easy.

From putty help chapter 3.8.3.6:

-m: read a remote command or script from a file
The -m option performs a similar function to the ‘Remote command’ box in the SSH panel of the PuTTY configuration box (see section 4.18.1). However, the -m option expects to be given a local file name, and it will read a command from that file.
With some servers (particularly Unix systems), you can even put multiple lines in this file and execute more than one command in sequence, or a whole shell script; but this is arguably an abuse, and cannot be expected to work on all servers. In particular, it is known not to work with certain ‘embedded’ servers, such as Cisco routers.
This option is not available in the file transfer tools PSCP and PSFTP.

According to documentation you should edit a local file and put a list of command you want to send to your server it can be a liste of command or a single command or event a remote shell script, but this might not work on every system.

Edit :

If you want to execute only one command from putty GUI you can also according to the help manual of putty section 4.18.1

In SSH, you don't have to run a general shell session on the server. Instead, you can choose to run a single specific command (such as a mail user agent, for example). If you want to do this, enter the command in the ‘Remote command’ box.

PuTTY SSH password not working

PuTTY SSH Remote Desktop

PuTTY SSH ProxyCommand

PuTTY SSH execute command

PuTTY direct download