Share via

How to zip multiple folders at once

Anonymous
2023-12-31T13:39:25+00:00

I want to zip multiple folders at once into their own zip files but I don't know how.

Windows for home | Windows 10 | Files, folders, and storage

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

5 answers

Sort by: Most helpful
  1. Les Ferch 10,326 Reputation points Volunteer Moderator
    2023-12-31T18:16:52+00:00

    Option 1: PowerShell Script

    You can create a zip file or each subfolder to its own zip file with a PowerShell script.

    You can ask ChatGPT to write that script for you. For example, I gave ChatGPT this directive:

    Write a PowerShell script that will create a zip file of each subfolder (not recursive) found within the path provided as a command line argument.

    And it produced this script:

    ZipFolders.ps1

    param ( 
    
        [string]$FolderPath 
    
    ) 
    
    # Check if the provided path exists 
    
    if (-not (Test-Path -Path $FolderPath -PathType Container)) { 
    
        Write-Host "Invalid path. Please provide a valid folder path." 
    
        exit 
    
    } 
    
    # Get a list of subfolders 
    
    $subfolders = Get-ChildItem -Path $FolderPath -Directory 
    
    foreach ($subfolder in $subfolders) { 
    
        $zipFileName = Join-Path -Path $FolderPath -ChildPath "$($subfolder.BaseName).zip" 
    
        # Create a zip file for each subfolder 
    
        Add-Type -AssemblyName System.IO.Compression.FileSystem 
    
        [System.IO.Compression.ZipFile]::CreateFromDirectory($subfolder.FullName, $zipFileName) 
    
        Write-Host "Zip file created: $($zipFileName)" 
    
    } 
    
    Write-Host "Zip file creation complete for all subfolders." 
    

    Paste the code above into NotePad and save it. Suggested file name: ZipFolders.ps1.

    To make the script convenient to use, Alt-drag the script to the desktop to create a shortcut. Then right-click that shortcut, select Properties and then add powershell.exe -ExecutionPolicy ByPass to the beginning of the target field. This is necessary to enable drag and drop. Ensure there is a space between that command and the script path.

    Now you can drag and drop a folder to the shortcut and it will create zip files of all the immediate subfolders.

    Option 2: Third-Party Tools

    Alternatively, you can install a third-party zip tool such as BandiZip. It provides a right-click option to zip folders to their own separate zip files.

    6 people found this answer helpful.
    0 comments No comments
  2. Les Ferch 10,326 Reputation points Volunteer Moderator
    2023-12-31T19:08:07+00:00

    I do have 7-zip, but I don't see that option when right clicking :(

    You're right. I have BandiZip installed and it has the option. I could have sworn 7-Zip did too, but now that I search the topic, I see a bunch of workarounds using batch file for loops and such. You're better off using the PowerShell script in that case.

    I recommend switching to BandiZip.

    2 people found this answer helpful.
    0 comments No comments
  3. Anonymous
    2023-12-31T18:56:15+00:00

    I do have 7-zip, but I don't see that option when right clicking :(

    0 comments No comments
  4. DaveM121 869K Reputation points Independent Advisor
    2023-12-31T14:51:16+00:00

    Just checking with you, is there anything further I can help you with?

    0 comments No comments
  5. DaveM121 869K Reputation points Independent Advisor
    2023-12-31T14:11:28+00:00

    Hi, I am Dave, I will help you with this.

    There is no method to do that in Windows, that will always zip all the folders into one large zip archive file, it may be possible with some 3rd party zip utility, but not in Windows natively.

    0 comments No comments