Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to write a batch file to unzip files to their current folder from a given root folder.

Folder 0
    |----- Folder 1
    |          |-----
    |          |-----
    |          |-----
    |----- Folder 2
    |          |-----
    |----- Folder 3

So, I wish that my batch file is launched like so:

ocd.bat /d="Folder 0"

Then, make it iterate from within the batch file through all of the subfolders to unzip the files exactly where the .zip files are located.

So here's my question:

Does the Windows (from XP at least) have a command line for its embedded zip tool? Otherwise, shall I stick to another third-party util?

share|improve this question
I believe .NET has Zipping assemblies natively, so if powershell is an option for you that might be useful. – jishi Jun 3 '10 at 16:14
@jishi: Won't help you much in creating a ZIP file, though. That's just for compressing a stream; you would still have to fit some metadata in there somewhere. – Joey Jun 6 '10 at 23:45

Yeah, it's called COMPRESS.EXE

share|improve this answer
Shall I consider using it and assume that the users will for usre have it, or using a third-party would be preferable? – Will Marcouiller Jun 3 '10 at 16:20
isn't that on the windows isntallation cd for manually compress / decompress those filename.dl_ files? – jishi Jun 3 '10 at 16:25
It's built into Windows XP, which is what you asked for. Try it, right now, from your command line, and see what it says. – mfinni Jun 3 '10 at 16:26
It says "File not found blah blah blah...". Probably the PATH environment variable not set properly, I guess. Though this brings us to my alternative solution: third-party tool, which was also part of the question. =) – Will Marcouiller Jun 3 '10 at 16:37
Balls - I thought it was built into Windows XP, but it's part of the Resource Pack. But, if you're considering bundling a 3rd-party tool, why don't you just bundle compress.exe ? – mfinni Jun 3 '10 at 16:46
up vote 0 down vote accepted

My best guess goes with 7 Zip and its command line tool 7za.exe which I downloaded at: nload 7-Zip for Windows:.

Should you need the command line parameters or some examples of using 7za.exe, please see this link: 7-Zip Command-Line Examples

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.