Hello everyone. I would like to make a batch file that extracts the contents of MANY .zip files (<name>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.

Recommended Answers

All 8 Replies

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.

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

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...

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

"unzip /<filename><no.>.zip

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

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 ;)

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

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

WINRAR Can do batches.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.