2

I am using this command to direct login in SSH.

"C:\Program Files\PuTTY\putty.exe" -ssh msnoc@10.0.0.11 -pw mypassword -P pwd

But after login i want to run a command every time

sh isdn st | i Bs

Right now I am handling 20 server and its too time taking to login every server and putting the same command.

How do I create a batch file to automate auto login and running the above mentioned command?

Abhishek Gautam
  • 1,617
  • 3
  • 18
  • 29

1 Answers1

4

You can use below command :

C:\Program Files\PuTTY\putty.exe" -ssh msnoc@10.0.0.11 -pw mypassword -P pwd -M "C:\Program Files\PuTTY\script.txt

where script.txt contain your commands:

sh isdn st | i Bs
LuFFy
  • 8,799
  • 10
  • 41
  • 59
BinhLau
  • 56
  • 2