Plink batch file - Problem sending commands

From: Nigel Butler (nigel.butler_at_talk21.com)
Date: 08/31/04


Date: 31 Aug 2004 03:06:39 -0700

I have successfully created a batch file to connect to a remote Unix
computer using Plink from a windows PC.
Once connected I want the batch file to send some commands to the
remote computer to change the directory and to start analysis on a
certain file.

The batch file I am using is as follows:
__________________________________
     cd C:\Plink
     plink username@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 username@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 username@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



Relevant Pages

  • got it!
    ... set up a batch file in the winnt folder so i could run a series of commands ... You also have to lower the version of the policy, ... >> (you can use the scheduler to schedule remotely): ...
    (microsoft.public.win2000.security)
  • Re: Offline Defrag command line
    ... You can also create a batch file with all the commands pre-configured ... b/c you will have the commands and syntax in the batch file. ... It makes the life of an Exchange Admin easier. ...
    (microsoft.public.exchange.admin)
  • Re: Someone hacked one of my servers
    ... The first few commands are trying to open a C: drive by logging in with the ... The %1 command implies this is a batch file where the ... accounts named Admin or Administrator to allow future access. ... firewall logs Otherwise, ...
    (microsoft.public.win2000.security)
  • Re: Batch File Did Not Run Correctly
    ... commands in the batch file are exactly the same, ... drive got disconnected before the software finished the installation. ... I do not get any error message. ...
    (microsoft.public.windows.file_system)
  • Re: Bash Script (WAS:Re: Suse 9.3 on a desktop replacement)
    ... PerfectReign wrote: ... > I created a batch file called, ... typed commands -- it spanned 30+ batch files and close to 2000 lines. ... you really want user feedback in the form of echo commands (and ...
    (alt.os.linux.suse)