El código de salida de cualquier programa se almacena en la variable %ERRORLEVEL%
en un script por lotes.
Desde el manual de 7-zip:
7-Zip returns the following exit codes:
Code Meaning
0 No error
1 Warning (Non fatal error(s)). For example, one or more files were locked by some other application, so they were not compressed.
2 Fatal error
7 Command line error
8 Not enough memory for operation
255 User stopped the process
Por lo tanto: que puede hacer:
"\Program Files\7-Zip\7z.exe" l "\Backup Google Docs.7z"
if errorlevel 255 goto:user_stopped_the_process
if errorlevel 8 goto:not_enough_memory
if errorlevel 7 goto:command_line_error
if errorlevel 2 goto:fatal_error
if errorlevel 1 goto:ok_warnings
cautela, if errorlevel N
cheques que %ERRORLEVEL%
es mayor o igual que N, por lo tanto, usted debe ponerlos en orden descendiente.
Gracias. Eso funciona perfectamente! –