Errorlevel capturing from plink?



Hi,
I am able to connect via SSH to my server and run remote commands.
This seems to work fine interactively and so now I am trying create a
script to automate some commands. I am using plink with a command line
like:

plink -batch -i c:\myppk.ppk user@server cmd /c c:\temp
\commandfile.cmd

The connection works fine, and the command file does execute on the
remote server. However, my problem is that if the remote command file
fails for any reason, I don't seem to be able to capture this via an
errorlevel locally in my script. Plink always seems to return an
errorlevel = 0, even when I have redirected the errorlevel on the
server to a file and know it is non-zero. The commandfile.cmd on the
server currently finishes with:

EXIT %ERRORLEVEL%

Am I doing something obviously wrong?

Thanks in advance,
Phil Rossiter

.



Relevant Pages

  • Re: WINSOCK Question.
    ... Which would be encoded as follows for the ITC: ... Dim strURL As String, strFormData As String ... This again indicates that the POST command is doing the same ... It sends the command to the server, ...
    (microsoft.public.vb.controls.internet)
  • [2/3] POHMELFS: Documentation.
    ... * Client is able to switch between different servers (if one goes down, ... Each transaction contains all information needed to process given command ... are asynchronous and are sent to the server during system writeback. ... +POHEMLFS is capable of full data channel encryption and/or strong crypto hashing. ...
    (Linux-Kernel)
  • Re: Explanation of macros; Haskell macros
    ... > server and I got to dictate the form of the commands and arguments. ... it boiled down to (funcall command client-session args). ... Let's assume there is a type "Session" for sessions. ... You don't need the first constraint, ...
    (comp.lang.python)
  • Re: Explanation of macros; Haskell macros
    ... > server and I got to dictate the form of the commands and arguments. ... it boiled down to (funcall command client-session args). ... Let's assume there is a type "Session" for sessions. ... You don't need the first constraint, ...
    (comp.lang.lisp)
  • RE: Your message did not reach some or all of the intended recipie
    ... 220 AHSSBS03.allanhogansolicitors.local Microsoft ESMTP MAIL Service, ... For more instruction of the Telnet command line, ... > SMTP Virtual Server and click Properties. ... > This newsgroup only focuses on SBS technical issues. ...
    (microsoft.public.windows.server.sbs)