madox2
madox2

Reputation: 51841

Putty Configuration GUI - remote command from script

I can call Remote Command by local file from console(-m option) in putty.

Is it possible to do the same from Putty GUI(Connection->SSH->Remote command, or elsewhere)?

Upvotes: 0

Views: 883

Answers (1)

Oliver Matthews
Oliver Matthews

Reputation: 7803

So, to put it more clearly, the question is can we set a file as the source of the remote command in the gui.

Not directly, no - it explicitly takes only a string. Possibly one of the various putty forks has it added (although I can confirm kitty does not).

The only way I can think of to do it is to wrap putty in a script which reads the content of the file (whatever it is) and puts that value into the windows registry at HKEY_CURRENT_USER/Software/SimonTatham/PuTTY/Sessions/NAMEOFSESSION/RemoteCommand before executing putty.

Upvotes: 1

Related Questions