The batch file I am using is as follows:
__________________________________
cd C:\Plink
plink user...@computer.com -pw mypassword
__________________________________
This connects fine, and I can then type my commands by hand into the
CMD window ...
cd dirname ... change the Dir
abq641 job=jobname input=jobname... run the analysis
all works fine. However I am trying to get the batch file to execute
these commands for me, but I cannot get it to work. I have tried the
following
__________________________________
cd C:\Plink
plink user...@computer.com -pw mypassword
cd scratch
abq641 job=jobname input=jobname
__________________________________
but this does not execute the commands, it logs in fine and then stop
after the second line.
I have also tried
__________________________________
cd C:\Plink
plink user...@computer.com -pw mypassword -batch cd scratch
abq641 job=jobname input=jobname
__________________________________
but this does not even log in... it just closes the CMD window.
All works fine if I type the command in by hand, but I cannot get the
batch file to do it for me!! Please can any one offer me any help or
advice in this matter.
Regards
Nigel
Of course. The computer is not going to magically do what you want just
because you arrange the commands so they appear on the screen in a
suggestive order. :) You want plink to execute those commands on the
remote host, but you have done nothing to arrange that; you have put them
in the local batch file instead. They will be executed on the local
computer, after plink exits (having done nothing), just like any other
command you put in that file.
Place the commands you want run on the remote host in a separate file
foo.sh, and run "plink -batch ... foo.sh".
http://www.tartarus.org/~simon/puttydoc/Chapter7.html#S7.3
--
Richard Silverman
r...@qoxp.net