I need to handle files older than a day. Thereforw I use this:
forfiles -m %%~nxf /C "cmd /c start /wait /MIN 7z.exe t %%f" /d +1
Now I'd like to check if the progress of 7z.exe succeeded. How can I get the errorlevel
of the command inside the forefiles command? Is there any possibility?
I already tried following ways which did not work. errorlevel
always returns 0, even if I use broken files, that should return an error (2).
forfiles -m %%~nxf /C "cmd /c start /wait /MIN 7z.exe t %%f && echo ok || echo delete %%f" /d +1
forfiles -m %%~nxf /C "cmd /c start /wait /MIN 7z.exe t %%f && if errorlevel 2 (DEL %%f)" /d +1