1

I am trying to write a batch file to automate a PuTTY script. Right now the script successfully logs into the SSH server with this line

putty.exe -ssh user@ipaddress -pw password -m commands.txt > log.txt

My problem is that once it's logged in the server prompts me to hit "Ctrl+y to begin" afterwards it asks me to press "Enter". How would I imitate that in my commands.txt file?

0

1 Answer 1

2

Use Plink (PuTTY command-line tool).

It is a console application, hence it allows input redirection.

Create a text file that contains Ctrl+Y character followed by Enter character. I.e. 0x19 and 0x0A. And then follow with your commands.

Then you can do

plink -ssh user@ipaddress -pw password < input.txt
Sign up to request clarification or add additional context in comments.

Comments

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.