Path: number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!feed.xsnews.nl!border-1.ams.xsnews.nl!68.142.88.75.MISMATCH!hwmnpeer01.ams!news-out.ntli.net!newsrout1-gui.ntli.net!ntli.net!news.highwinds-media.com!newspeer1-win.ntli.net!newsfe6-gui.ntli.net.POSTED!53ab2750!not-for-mail
From: Esra Sdrawkcab
Organization: dis
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB;
rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.0
MIME-Version: 1.0
Newsgroups: alt.msdos.batch,fidonet.batpower
Subject: Re: ZipTest.bat (Testing Zips For Errors)
References:
In-Reply-To:
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 30
Message-ID:
Date: Mon, 25 Feb 2008 08:43:08 GMT
NNTP-Posting-Host: 82.11.225.61
25 Feb 2008 08:43:08 GMT)
NNTP-Posting-Date: Mon, 25 Feb 2008 08:43:08 GMT
Bytes: 2015
Xref: number1.nntp.dca.giganews.com alt.msdos.batch:93403 fidonet.batpower:583
FileGod wrote:
> OK, I just fixed ZipTest.bat so it will not handle all the files in a
> directory & move the zips to the errors directory, I messed up & posted this
> twice in the NT echo when I meant to post this here...
>
> if not (%1) == () goto ZipTest
> for %%a in (*.zip) do call ZipTest %%a
> goto end
> :ZipTest
> set Zip=%1
> PKUNZIP -t %1
> IF ERRORLEVEL = 1 Goto BadZip>nul
> echo %1 is OK
> goto end
> :BadZip
> Echo %1 Has Errors
> md Errors
> move %1 errors
> :end
>
I feel this could be made much more succinctly in NT:
@echo off
if not exist errors md errors
for %%a in (*.zip) do (pkunzip.exe -t %%a>nul||move %%a errors&&echo
Error in %%a)
(Watch wordwrap)
a tidyup line to "rd errors" if empty could be added if required
|