-3

a.bat file, starts putty and executes commands written in the p.txt file:
image1

p.txt file contains commands:
image2

aschipfl
  • 33,626
  • 12
  • 54
  • 99
  • 1
    What error are you getting ? – Inder Kumar Rathore May 10 '18 at 10:08
  • Stack Overflow is a site for programming and development questions. This question appears to be off-topic because it is not about programming or development. See [What topics can I ask about here](http://stackoverflow.com/help/on-topic) in the Help Center. Perhaps [Super User](http://superuser.com/) or [Unix & Linux Stack Exchange](http://unix.stackexchange.com/) would be a better place to ask. – jww May 11 '18 at 00:25

1 Answers1

-1

According to the docs you can run single command or script file using -m (Exceptions for some unix servers). Please read the excerpt from the docs below

3.8.3.6 -M: READ A REMOTE COMMAND OR SCRIPT FROM A FILE

The -m option performs a similar function to the ‘Remote command’ box in the SSH panel of the PuTTY configuration box (see section 4.18.1). However, the -m option expects to be given a local file name, and it will read a command from that file.

With some servers (particularly Unix systems), you can even put multiple lines in this file and execute more than one command in sequence, or a whole shell script; but this is arguably an abuse, and cannot be expected to work on all servers. In particular, it is known not to work with certain ‘embedded’ servers, such as Cisco routers.

This option is not available in the file transfer tools PSCP and PSFTP.

Community
  • 1
  • 1
Inder Kumar Rathore
  • 39,458
  • 17
  • 135
  • 184