ZIP files come in two varieties, oddly mirroring the users which create them...
The first variety has the files directly in the root of the zip files. These are created by users who select multiple files and create an archive out of them.
The second variety has the files stuck inside a directory that is in the root of the archive. This was accomplished by selecting a single directory and then creating an archive out of that.
(OK, there's far more varieties, but they are just worse and arguably insane variations of the second variety...)
When you extract the first kind, you'll want to extract it to a subdirectory, usually using an option like 'Extract to MyZipFile\'. Otherwise, you get the crap stuck in the middle of all your other files, which is really annoying!
When you extract the second kind, you want to extract it to the same directory, because otherwise you've got a wonderful beginning with matroshka dolls: a single directory inside a directory. It's just annoying.
And unless you peek inside a zip (as opposed to rightclicking and just extracting like I tend to do) there's no other option but to guess... and since the least damaging option is to extract into a new directory, you will thus end up with the worst-case scenario of the second variety.
So what is this little script about?!
Basically, I had to extract about a thousand zip files... and they were a mix of both varieties. Fixing the nested directories manually... yeah. I wasn't going to put myself through that pain. So instead I wrote a pair of batch files.
It's just a simple script, but since I happened to need to do a lot of it, I figured I'd automate it and then share it with all of you.
Squash-All: Squashes all subdirectories of the current directory.
Squash-Directory: Squashes a given directory.
There's no real special features save for the fact it avoids conflicts where you have a folder 'test' inside a folder 'test' which could cause issues whilst moving the files up a level. Other than that, it's just a batch file.
Have fun? :-)