5

Is it possible to unzip .ZIP file using .BAT command on Windows XP? we have file.zip how to create a .BAT commands file to unzip\unpack it to some folder. USING ONLY NATIVE WINDOWS XP programms and commands.

So.. How to do such thing? (code example, please)

Rella
  • 65,003
  • 109
  • 363
  • 636

3 Answers3

6

Yes.

But it involves using "scripting" and the use of System.FileSystemObject (a good keyword). You should be able to use cscript/WSH which can run VBScript or JScript (WSH 5.6 comes with XP). The general idea is here. There are some other interesting "issues" with this approach though; the operations runs asynchronously and the compression dialog box may appear -- but it can be done using standard XP tools.

I would recommend downloading 7-zip. It is a 200~400k standalone command-line executable (depending on version), but it requires an initial "install" to grab the executable first. You don't need the GUI to run 7-zip.

  • 2
    I tried to use this solution (years ago), but the dialogs popping up (progress bar, blocking error messages) were just annoying. Command line utility is definitely the way to go. – devio May 20 '10 at 16:16
  • Do you have XP? can you test this http://stackoverflow.com/questions/2874387/how-to-create-a-bat-file-to-download-and-unpack-a-zip-file/2875264#2875264 one? – Rella May 20 '10 at 16:21
  • @Ole Jak No XP now. I have done this years ago on XP/2k systems and more recently on Windows 7 with PowerShell (I don't know what I was thinking). See what devio said as it does apply -- and hence the recommendation to get a real utility. Happy ... coding? –  May 20 '10 at 16:29
1

Short answer: No. Explanation: https://serverfault.com/questions/39071/does-windows-have-a-built-in-zip-command-for-the-command-line

Community
  • 1
  • 1
Ron
  • 7,588
  • 11
  • 38
  • 42
1

No, there is no command line support for the native zip/unzip library that comes with windows XP. The only solution would be to use a uncompressing library.

jpabluz
  • 1,200
  • 6
  • 16