FreeFileSync Manual: Run a FreeFileSync batch job - Wrong description ...

Discuss new features and functions
Posts: 102
Joined: 14 Feb 2015

volker01

In the Manual under Section:
1. Run a FreeFileSync batch job ...
You can evaluate these codes from a script ...
you wrote:
if not %errorlevel% == 0 ...

This is not correct:
this means: if not errorlevel 0 (-> or higher!) ...
When you want to know errorlevel 0
you have to write:
if not errorlevel 1 ( ... )
Posts: 1038
Joined: 8 May 2006

therube

In his example, he is not checking for success, (0), rather for "something went wrong", so NOT 0 is correct in that regard.

If, "you want to know errorlevel 0", i.e., success (in your second paragraph), that is different from what his example describes, & so the check for that would need to be different.

If you wanted to check for success, that specific exit code, then simply check for,
if %errorlevel% == 0 echo success
or
if %errorlevel% EQU 0 echo success
Posts: 102
Joined: 14 Feb 2015

volker01

You are right, my mistake, sorry. I read:
"if not errorlevel = 0,
but I thought of
"if not errorlevel 0".
That is of course something different.