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 ( ... )
FreeFileSync Manual: Run a FreeFileSync batch job - Wrong description ...
- Posts: 102
- Joined: 14 Feb 2015
- Posts: 1028
- Joined: 8 May 2006
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
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
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.
"if not errorlevel = 0,
but I thought of
"if not errorlevel 0".
That is of course something different.