Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

dcstar

No worries, I have gone in the dual scripts direction (though it would be nice to have a feature in the next version to reset the errorlevel..........) :wink:
martin

Re: Reset errors in scripted operation

Sorry, I've missed that. Then you need to make two scripts.
dcstar

Re: Reset errors in scripted operation

martin wrote:

dcstar wrote:

I am creating a specific remote directory as part of the script - I don't really care if the directory already exists - but if the directory does exist, the resulting error returns an Errorlevel 1 when the script exits (it works fine if the directory doesn't exist).

I only want the Errorlevel 1 if subsequent file transfers fail!

The script should exit after error, only if you have "option batch abort" set. Do you? Then unset it before creating the directory, and reset it back afterwards:
...

option batch on
mkdir <path>
option batch abort
put ...

The issue isn't the script exiting with the abort option, the issue is when the script ends after successful file transfers, a previous mkdir failure returns errorlevel 1.

I had hoped that using additional "option abort" commands would reset the returned errorlevel in the script back to 0, but this doesn't seem to occur.
martin

Re: Reset errors in scripted operation

dcstar wrote:

I am creating a specific remote directory as part of the script - I don't really care if the directory already exists - but if the directory does exist, the resulting error returns an Errorlevel 1 when the script exits (it works fine if the directory doesn't exist).

I only want the Errorlevel 1 if subsequent file transfers fail!

The script should exit after error, only if you have "option batch abort" set. Do you? Then unset it before creating the directory, and reset it back afterwards:
...

option batch on
mkdir <path>
option batch abort
put ...
dcstar

Reset errors in scripted operation

Hello there, I have managed to successfully get a scripted job running, but I need to either have it ignore a possible error early in the script, or I need to be able to only capture errors later in the script.

I am creating a specific remote directory as part of the script - I don't really care if the directory already exists - but if the directory does exist, the resulting error returns an Errorlevel 1 when the script exits (it works fine if the directory doesn't exist).

I only want the Errorlevel 1 if subsequent file transfers fail!

It has to be this way as a separate process re-runs the script an hour later if it initially returned an error.

I think I can do a "workaround" by running two separate scripts, one to create the directory (without any error checking) and then one to do the transfers, but I'd rather have it all in one script for simplicity's sake.

I am using version 3.7.6 in a Windows XP environment.