Dear all
I have a problem with the branching in the batch below
even when the test fails and echo %errorlevel% shows 1
the branching still goes to gziperr0
Does enyone knows why and how to fix ?
echo %time%
echo testing .gz
gzip -d -f -t myfile.snf.gz
echo %errorlevel%
if errorlevel 0
I have a problem with the branching in the batch below
even when the test fails and echo %errorlevel% shows 1
the branching still goes to gziperr0
Does enyone knows why and how to fix ?
When you echo the errorlevel, the errorlevel is reset to the value
returned by echo().
--Sandy
I have a problem with the branching in the batch below
even when the test fails and echo %errorlevel% shows 1
the branching still goes to gziperr0
Does enyone knows why and how to fix ?
When you echo the errorlevel, the errorlevel is reset to the value
returned by echo().
--Sandy
Serge:
if errorlevel 0 means if errorlevel = 0. You are NOT comparing to
equal - it will return TRUE if the error level is AT LEAST the number 0 -
which is true for any positive value.
Best Regards,
Andy
-Original Message-
From: supp...@declude.com [mailto:supp...@declude.com] On Behalf
Not true
even if i comment echo line, i still get gzip OK errorlevel 0, Unzipping
even if the file if corrupted
You're right, scanned too fast.
But as Andy said, you're not doing an equality test. Do if
%errorlevel%==1, etc.
--Sandy
Serge:
if errorlevel 0 means if errorlevel = 0. You are NOT comparing to
equal - it will return TRUE if the error level is AT LEAST the number 0 -
which is true for any positive value.
Best Regards,
Andy
-Original Message-
From: supp...@declude.com [mailto:supp...@declude.com] On Behalf
Not true
even if i comment echo line, i still get gzip OK errorlevel 0, Unzipping
even if the file if corrupted
You're right, scanned too fast.
But as Andy said, you're not doing an equality test. Do if
%errorlevel%==1, etc.
--Sandy