Tip - How to batch unzip files (Windows)

I'm picky on my folder organization so I still manually download items (or use DIM to download) and extract them into different Content Directories (by genre or by project).  Also, I like to combine older products that were broken into smaller parts into one larger file for ease of installation.  I found an easy way to unzip several files as a time.


Download 7zip and install - it's free:  http://www.7-zip.org/download.html (The commands below assume you use the default installation path.)

Create a temp folder for the unzip. (I'm using "d:\UnzipMe" for the example.)

Copy the .zip files to d:\UnzipMe (or move them if you're going to replace the .zip files with one large one.)

Open up the command prompt.  Type the following commands:

  • cd /d d:\UnzipMe
  • "C:\Program Files\7-Zip\7z.exe" x *.zip -od:\UnzipMe

x = extract with subfolder organization

-o = source folder.  There's NO space between the -o and the destination folder.  You can set a different destination folder than where you're running the command from, such as d:\NewDAZContentDirectory

If there are duplicate files, like license.txt, readme.txt, etc., 7Zip will prompt you on what action to take (overwrite, rename, etc.)

Tips - if you're going to do this multiple times in one session, you can hit the up arrow in the command window to repeat the last command so you don't have to type it again.  If you're combining .zips, you can then select the extracted folders, right click, and use 7Zip to turn them into one .zip.


If you want to extract the zips, each one in its own folder using the .zip name as the folder name:

  • cd /d d:\UnzipMe
  • "C:\Program Files\7-Zip\7z.exe" x *.zip -o*

You'll get folders like IM0001_blah, IM0002_blah, etc., with the contents inside.


7Zip is also available for Linux so it's shouldn't be difficult to adapt the instructions.  MacOs - no 7Zip for you.  The download page lists some similar zip programs - it's likely one or more of them have similar command line functions.

 

Cheers!

Comments

  • mtl1mtl1 Posts: 1,507

    There's no space between -o and the destination folder? That's going to be super confusing. Thanks for the tip though; I have a couple of older RDNA items that are multi-zip packaged that I haven't unzipped yet.

  • Richard HaseltineRichard Haseltine Posts: 104,149

    Isn't the first the same as Extract Here from the 7-Zip sub-menu when right-clicking on a zip file or files?

Sign In or Register to comment.