Errorlevel capturing from plink?
- From: MrPhil007 <philrossiter@xxxxxxxxxxxxxx>
- Date: Tue, 10 Jul 2007 03:17:08 -0700
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
.
- Follow-Ups:
- Re: Errorlevel capturing from plink?
- From: MrPhil007
- Re: Errorlevel capturing from plink?
- Prev by Date: Re: root login from one IP; user from any?
- Next by Date: passing arguments to remote: quoting problem?
- Previous by thread: root login from one IP; user from any?
- Next by thread: Re: Errorlevel capturing from plink?
- Index(es):
Relevant Pages
|
|