0

I have a zip file that contains many files. Each file in the zip file is about 100MB, and is compressed about 10% (IE it is about 90MB in the zip file). The whole zip file is 20GB, and I'm trying to unzip it onto a drive that has only 30GB free.

On Windows 7, how can I unzip a zip file on my laptop's harddrive that doesn't have enough space for both the zipped and unzipped copies of the file?

IE can I tell windows to remove stuff from the zip file as it is uncompressed?

3
  • Can you burn the zip file to an optical disc (CD or DVD), delete it from the hard disk, and then unzip it from the CD? Jun 28, 2013 at 3:04
  • Good thought, @Scott, but it's too big for any opitcal or USB flash drives I have available. Jun 28, 2013 at 3:20
  • Unzip some of the files, and write those to CDs?
    – MSalters
    Jun 28, 2013 at 12:12

4 Answers 4

1

Sane(-oid) Method

If you had a big enough flash drive (or writable network location, like another CIFS-capable computer on the network), you could extract one file at a time from the archive, then delete the file from the archive, using the (~20GB free) "other space" as the temporary/scratch location. Every archiving utility I've ever worked with can specify an alternate temporary location.

This example script uses 7-zip (as well as grep and sed):

@ECHO OFF
SETLOCAL

SET ARCHIVE=temp.zip
SET SCRATCH_PATH=D:\temp
SET DEST_DIR=%~dp0\extracted

FOR /F "delims=*" %%f IN ('7z.exe l "%ARCHIVE%" -slt ^| grep -B1 "Folder = -" ^| grep "Path = " ^| sed "s/Path = //"') DO (
    @ECHO.
    @ECHO %%~f
    7z.exe x -y -o"%DEST_DIR%" -w"%SCRATCH_DIR%" "%ARCHIVE%" "%%~f" >NUL
    7z.exe d -w"%SCRATCH_DIR%" "%ARCHIVE%" "%%~f" >NUL
    FOR %%g IN (%ARCHIVE%) DO @ECHO   %ARCHIVE%: %%~zg
)

It is functionally correct, though I did not attempt to create a file too big to extract on my computer just to test it.

Crazy Method

You could also temporarily compress some files on the hard drive that you know you won't need during the extraction process (like, say Office) to free up just enough space to extract the files, then reverse the process once extraction is complete.

0

I don't think you can pull this off. I don't know of any Windows zip utility that can extract a file and then in place truncate the archive without even using a temporary file. You'll just need to do this on a drive with adequate space available.

4
  • This is what I'm afraid of... I'm going to leave the question open for a few days, see if I get someone who knows how to do it. If not, I'll accept your answer. Jun 28, 2013 at 4:22
  • Technically it's possible (follow the link from my answer here for the requisite steps), but you'll be hard pressed to find any utility that does this. Not only is it rarely required, but not using a temp file and shifting compressed data/file records inside the existing archive is just a recipe for disaster. If you can program then perhaps you can look into it (the SO question even has code to get you started), but I'd say implementing it would be a waste of time.
    – Karan
    Jun 28, 2013 at 4:30
  • After re-reading your question, just want to confirm something. Are you saying the drive has 30GB free after copying the 20GB archive to it? Because if that ~10% compression figure you gave is true, that means the files uncompressed would be ~22GB. Let's say ~25GB max, which of course can fit inside the 30GB free space.
    – Karan
    Jun 28, 2013 at 18:05
  • No, the drive has 30BG free before putting the 20GB file on it. Re-reading my question, I wasn't clear, but you did interpret it correctly. Jul 18, 2013 at 13:23
0

Super simple solution: Copy to a portable HDD and unzip it, or give it to a friend to unzip.

2
  • 1
    though this seems like the most obvious way to do it, it might not be possible to do what you are suggesting in a corporate environment.The uniformity of file sizes and compression ratios suggest that the files are some kind of log files or data files. It could be confidential stuff
    – Shekhar
    Jun 28, 2013 at 18:13
  • 2
    This would work for someone who has a portable HDD. Jul 18, 2013 at 13:24
-1

haven't tried it, but this might work ... http://www.hongkiat.com/blog/unzip-files-online-with-wobzip/

Wobzip is an online service that helps you to unzip almost any compressed formats it currently supports up to 100Mb of single compressed file so it would suit your purpose.

Upload your files to the server, and then you can delete the existing zip and then download the uncompressed file contents

It doenot support unicode, but will work with password protected files

2
  • 1
    The zip file is 20 GB in size, so no doubt it'll take ages to upload. But let's forget that for a bit. You don't need to try what you're recommending, but you could at least read that page you linked to carefully: "Wobzip is an online service that ... currently supports up to 100 MB of single compressed file."
    – Karan
    Jun 28, 2013 at 17:57
  • -1 Won't work, my file's too big for their service. Jul 18, 2013 at 13:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .