Tol!k

|
Posted: Sun Jul 12, 2009 11:34 Post subject: |
|
|
::::::::::::::::::::::::: arctest.cmd :::::::::::::::::::::::::
@echo off &chcp 1251 >nul
setlocal enableextensions
rem Тест с логом архивов с ошибками. Используется 7z.exe
rem Параметры: /S - тест архивов в подкаталогах
rem Автор: Tol!k
rem Файл arcerror.txt содержит строки
rem Error:
rem Errors:
set "arc4test=*.zip *.arj *.rar *.7z"
if /i "%1"=="/s" (set "subdir=/s") else set "subdir="
if exist %tmp%\arc4test.tmp exit /b
dir %arc4test% /b %subdir% >%tmp%\arc4test.tmp
set "err=%~dp0\arcerror.txt"
if not exist "%err%" (
echo Error:>"%err%"
echo Errors:>>"%err%"
)
for /f "delims=" %%f in (%tmp%\arc4test.tmp) do (
title %%f
C:\Progra~1\7-Zip\7z.exe t "%%f"|findstr /g:"%err%" &&(
echo %%f &echo.
echo %%f>>arcerror.lst
)
)
title Done.
if exist arcerror.lst (
echo Архивы с ошибками:
type arcerror.lst |more
) else echo OK.
del /q %tmp%\arc4test.tmp
pause &exit /b
::::::::::::::::::::::::: arctest.cmd ::::::::::::::::::::::::: |
|