Article View: comp.os.msdos.misc
Article #3927Re: batch file to unzip each .ZIP file to its own directory (repost)
From: Bruce Milmine
Date: Tue, 05 Dec 1995 00:00
Date: Tue, 05 Dec 1995 00:00
107 lines
3824 bytes
3824 bytes
John Savage <koala@sydney.dialix.com.au> wrote:
>To explain this .bat script: you have downloaded a few .ZIP files from
>some site, and need to unzip each and run them -- to test whether the
>programs do what you hope and are worth keeping. Usually, this means
>creating a handful of subdirectories, and unzipping one .ZIP into each.
>This batch program does that task for you: it will create a subdirectory
>[within the current directory] named according to each of the .ZIP files
>specified, and unzip each file into its own directory. For example, a
>file named DC106F.ZIP will be unzipped into a subdirectory named DC106F
Interesting little BAT file. I have a bat file I call UNZIP.BAT that
does similat functions ... except all on the Hard Drive and always in the
same place. It will unzip (read: un-compress) ZIP's, ARJ's, LZH and ARC
files at the present, then scan for viruses using F-Prot. I ise a smal
COM file (WAIT.COM) to allow me to see what's what at two critical areas.
My communications progran automatically downloads to F:\ZIP and
this BAT file works in F:\ZIP\UNZIP, all subdirectories are created under
that directory.
Here it is: UNZIP.BAT
@echo off
cls
f:
cd\zip
if not exist *.zip goto AR
for %%f in (*.zip) do md f:\zip\unzip\%%f
for %%f in (*.zip) do pkunzip %%f f:\zip\unzip\%%f\
:AR
if not exist *.arj goto LZ
for %%f in (*.arj) do md f:\zip\unzip\%%f
for %%f in (*.arj) do arj e %%f f:\zip\unzip\%%f\
:LZ
if not exist *.lzh goto PK
for %%f in (*.lzh) do md f:\zip\unzip\%%f
for %%f in (*.lzh) do LHA e %%f f:\zip\unzip\%%f\
:PK
if not exist *.arc goto S-IT
for %%f in (*.arc) do md f:\zip\unzip\%%f
for %%f in (*.arc) do PKUNPAK %%f f:\zip\unzip\%%f\
:S-IT
echo.
echo Pausing for 30 seconds. [ Hit *any* key to continue ]
echo.
wait 30
cls
cd\zip\unzip
F-PROT.EXE f:\zip\unzip /all /append /auto /disinf /guru /nomem /old
/report=f:\zip\f-prot.rpt
if errorlevel 8 goto EIG
if errorlevel 7 goto SEV
if errorlevel 6 goto SIX
if errorlevel 5 goto FIV
if errorlevel 4 goto FOU
if errorlevel 3 goto THR
if errorlevel 2 goto TWO
if errorlevel 1 goto ONE
if errorlevel 0 goto ZER
:EIG
echo 8 - At least one suspicious file was found, but no infections.
goto END
:SEV
echo 7 - Insufficient memory to run the program.
goto END
:SIX
echo 6 - At least one virus was removed.
goto END
:FIV
echo 5 - Program terminated with ^C or ESC.
goto END
:FOU
echo 4 - Virus search string found in memory.
goto END
:THR
echo 3 - A Boot/File virus infection found.
goto END
:TWO
echo 2 - Selftest failed - program has been modified.
goto END
:ONE
echo 1 - Abnormal termination - unrecoverable error.
goto END
:ZER
echo 0 - Normal exit - nothing found
goto END
:END
echo.
echo Pausing for 30 seconds. [ Hit *any* key to continue ]
echo.
wait 30
echo.
Bruce Milmine
http://www.newedge.net/wbm
Bruce Milmine
Dartmouth, Nova Scotia, Canada
http://www.newedge.net/wbm
wbm@newedge.net
Technical Details
Message-ID:
<4a1ku5$ddp@apollo.newedge.net>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<48uv5t$k39$1@sydney.DIALix.oz.au>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10d683,696b2ebc08f0432d X-Google-Attributes: gid10d683,public X-Google-Thread: f53ba,696b2ebc08f0432d X-Google-Attributes: gidf53ba,public X-Google-Thread: 111d31,696b2ebc08f0432d X-Google-Attributes: gid111d31,public X-Google-Thread: f71eb,696b2ebc08f0432d X-Google-Attributes: gidf71eb,public From: wbm@newedge.net (Bruce Milmine) Subject: Re: batch file to unzip each .ZIP file to its own directory (repost) Date: 1995/12/05 Message-ID: <4a1ku5$ddp@apollo.newedge.net> X-Deja-AN: 121137200 references: <48uv5t$k39$1@sydney.DIALix.oz.au> organization: NewEdge InterAccess newsgroups: comp.os.msdos.misc,comp.archives.msdos.d,comp.sys.ibm.pc.misc,aus.computers.ibm-pc