0

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)?

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

3 Comments

You right, kitty does, but I need to use putty. What do you exactly mean "wrap putty in a script which reads the content of the file"?
I mean write a powershell script / batch file that: 1. gets the contents of the script you want to have run. 2. updates the registry at the key provided. 3. invokes putty. Then call this rather than putty
Yes this can solve the problem, but its too cumbrous. Anyway thank you for your response!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.