2

wants to execute the Unix commands saved in text file from batch file using putty.

I've created a .bat file with this line:

start C:\Users\putty.exe -load "server" -l userID -pw Password -m commands.txt

and commands.txt file contained Unix command

ls 

I got the success to logged-in in my account through putty But the command ls added in text is not executed

Assuming there is no need to use plink.exe since i can logged-in with putty.exe itself

2
  • no error msgs? Good test case, but maybe try /bin/ls or echo inside test script? Good luck. Commented Apr 22, 2014 at 14:40
  • yes, no error message. also tried with tail -5000 /bin/abc/| grep 'keyword' . But my concern is tail command not even get written on putty command window. Commented Apr 22, 2014 at 19:29

1 Answer 1

2

Its getting executed, its just you are not able to see it, it disappers before you can note anything

to be sure just change your command.txt content from

ls 

to

ls >file_ls

and then check the file 'file_ls' in your home directory on "server" It will have ls output.

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.