Fab's AutoBackup forums

Welcome to Fab's AutoBackup technical support forums
Bienvenue sur les forums de support technique de Fab's AutoBackup

You are not logged in.

Announcement


Due to a large amount of fake accounts registrations for advertising purpose (spam), this forum does not accept new registrations any longer.
You can still browse existing threads to find the help you are looking for. If you do not find it and have questions, please use this contact form.

====================================

En raison d'un nombre important d'enregistrements de faux comptes utilisateurs à des fins de spam (publicité non sollicitée), il n'est désormais plus possible de s'enregistrer sur les forums de support technique.
Vous pouvez toujours parcourir les sujets existants pour trouver ce que vous recherchez. Si vous ne trouvez pas l'information et avez des questions, veuillez utiliser ce formulaire de contact.

#1 2022-02-24 18:57:54

Thrakorzog
Member
Registered: 2018-08-23
Posts: 12

Batch File return Error Codes -ERRORLEVEL

I would like to get the exit codes so that I could flag any failures programmatically as I run the script.

So something like:
/batchFile.cmd
AutobackupPro7.exe [commandline stuff]
If %ERRORLEVEL%==2 Echo Bad Thing 2 happened | GOTO END
If %ERRORLEVEL%==1 Echo Bad Thing 1 happened | GOTO END
If %ERRORLEVEL%==0 Echo Good Thing happened | GOTO END

:END

Offline

#2 2022-02-24 19:01:25

Fab
Administrator
Registered: 2011-05-11
Posts: 1,307

Re: Batch File return Error Codes -ERRORLEVEL

Thrakorzog wrote:

I would like to get the exit codes so that I could flag any failures programmatically as I run the script.

So something like:
/batchFile.cmd
AutobackupPro7.exe [commandline stuff]
If %ERRORLEVEL%==2 Echo Bad Thing 2 happened | GOTO END
If %ERRORLEVEL%==1 Echo Bad Thing 1 happened | GOTO END
If %ERRORLEVEL%==0 Echo Good Thing happened | GOTO END

:END

I'll look into it an try to add it in a next version


Fab

Offline

#3 2022-02-24 19:18:11

Fab
Administrator
Registered: 2011-05-11
Posts: 1,307

Re: Batch File return Error Codes -ERRORLEVEL

I've added the following piece of code in program close instructions :

If WarningCount=0 and ErrorCount=0 then ExitCode:=0;
If WarningCount>0 then ExitCode:=1;
If ErrorCount>0 then ExitCode:=2;

That should do the trick in next version.


Fab

Offline

#4 2022-02-24 20:13:41

Thrakorzog
Member
Registered: 2018-08-23
Posts: 12

Re: Batch File return Error Codes -ERRORLEVEL

Excellent!!! Merci!!!

Offline

Registered users online in this topic: 0, guests: 1
[Bot] claudebot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.035 seconds, 8 queries executed - Memory usage: 508.51 KiB (Peak: 509.15 KiB) ]