-3

I am writing a .bat file to execute commands in putty. I need to load a saved session, then i need to enter a 'terminal id' and press enter, then i need to enter a user name and password. Can anyone help me?

Hennes
  • 65,804
  • 7
  • 115
  • 169

1 Answers1

0

There is confusion in your question, and in some answers and comments.

A batch file is a windows command line thing(or a DOS thing) , not a linux thing.

All the examples people have given you are more for running linux commands remotely or for running a batch of linux commands. Not batch files.

If you ever try using batch files it wouldn't be in the context of a session having logged onto a linux machine.

If you want to run a batch of commands, e.g. a bash file (which has a batch of commands), or a script that runs a batch of commands, some comments mention how to do that. The duplicate question How to type commands in PuTTY by creating batch file? also wrongly mentions batch files in the question, but answers state how to run a batch of commands on a linux system you log into. Mostly if using putty or whatever ssh client, it will load a linux console (unless e.g. the remote machine is windows and running an ssh server that gives a windows command line, like bitvise winsshd). But mostly remote machines people log into tend to be linux or sometimes windows running openssh, and give a linux command line, and so one would run a bash file or script linux can run. Not a batch file.

Really you should learn how to run a batch file on a windows machine. And learn how, when on a linux machine, to run a script e.g. a bash file. And then it will be more clear to you what you want to do when you add something like logging in and automatically running a script.

barlop
  • 25,198