"Mogrify" error handling in Windows batch
Posted: 2017-02-14T01:28:36-07:00
I'm writing a Windows batch file to change folders full of TIF files to JPG and want it to go to an error-handling label if the TIF file is invalid. The relevant code is essentially
but even when I run it on test TIFs designed to fail the test, it returns an errorlevel of 0, so I can't brandh to the error reporting subroutine. How can I make Mogrify return proper error codes? Thanks.
Code: Select all
mogrify.exe -format jpg "%1"
if not %ERRORLEVEL%==0 goto :BAD_FILE