954,224 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

batch file help - extraction

Hello everyone. I would like to make a batch file that extracts the contents of MANY .zip files (001-146) to a certain folder, without having to manually extract them. My .bat skills are not good enough to do it and it would be a usuful tool that i currently need. Can someone please post the batch code that will do this.

many thanks in advance.

marceta
Posting Whiz in Training
217 posts since May 2004
Reputation Points: 13
Solved Threads: 0
 

Hello,

The older DOS PKUNZIP might work for you. I wonder if WinZip has something like that available too.

I wonder if you could instead of getting a bunch of .ZIP files, if your source could send you ONE zip file with everything inside it.

You cannot just go PKUNZIP *.ZIP as your files would be placed in the working folder and be mingling with your .ZIP files too. That would be bad.

Good luck on this one.

kc0arf
Posting Virtuoso
Team Colleague
1,937 posts since Mar 2004
Reputation Points: 121
Solved Threads: 57
 

thx for tryin, winzip cant do it and i am NOT prepared to do it myself:@ does anyone know how to do it?

marceta
Posting Whiz in Training
217 posts since May 2004
Reputation Points: 13
Solved Threads: 0
 

Can you extract them from the command line how you want? If not, the rest of the post won't be very useful.

To get a file listing of all the zip files in a directory, use:

dir *.zip /b > names.txt

your batch file may go something like this (stick with me, I'm used to Linux)
Oh, and one more note: I use binary numbers for temporary directory names just so I can practice binary.

mkdir 00000000
cd 00000000
unzip ../filename.zip
cd ..

mkdir 00000001
cd 00000001
unzip ../filename2.zip
cd ..

and so on...

Puckdropper
Posting Pro
500 posts since Jul 2004
Reputation Points: 23
Solved Threads: 23
 

cool man, thx. Ive got the list of files, now, i cant the extract to work. i have

"unzip /.zip

but no good. is it something to do with those numbers (i dont really get them)

marceta
Posting Whiz in Training
217 posts since May 2004
Reputation Points: 13
Solved Threads: 0
 

Hey marceta. Have you considered that some of those zip archives might contain files with the same filename? Extracting all the archives into the one directory as a 'batch' operation might not be the wisest thing to do. You might just end up with some files lost from the exercise ;)

Catweazle
Grandad
Team Colleague
4,335 posts since Mar 2004
Reputation Points: 229
Solved Threads: 149
 

well it took about 30mins, but i did it all by hand, i guess i should feel proud, but i dont :P

marceta
Posting Whiz in Training
217 posts since May 2004
Reputation Points: 13
Solved Threads: 0
 

Go and celebrate by having a nice cold can of root beer. I find Barqs is best Ice Cold. ;-)

Puckdropper
Posting Pro
500 posts since Jul 2004
Reputation Points: 23
Solved Threads: 23
 

WINRAR Can do batches.

JR85023
Junior Poster in Training
86 posts since May 2004
Reputation Points: 17
Solved Threads: 6
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You