I have a batch file in which I execute the following line to list the contents of an archive:
"\Program Files\7-Zip\7z.exe" l "\Backup Google Docs.7z"
The archive is intentionally corrupted.
cmd.exe displays this:

How can I catch this error in my code?
Any program’s exit code is stored in the
%ERRORLEVEL%variable in a batch script.From the 7-zip manual:
So: you can do:
Caution,
if errorlevel Nchecks that%ERRORLEVEL%is greater or equal than N, therefore you should put them in descending order.