Skip to content

Instantly share code, notes, and snippets.

@NikhilMath
Last active March 26, 2026 15:12
Show Gist options
  • Select an option

  • Save NikhilMath/944d4d7fdc7fc3cc40bbb8d76e7418ad to your computer and use it in GitHub Desktop.

Select an option

Save NikhilMath/944d4d7fdc7fc3cc40bbb8d76e7418ad to your computer and use it in GitHub Desktop.
Bulk Extract ZIP Files (Windows 11 PowerShell)

Bulk Extract ZIP Files (Windows 11 PowerShell)

Overview

This script extracts all .zip files in your Downloads folder into individual folders (same name as each ZIP file) in the Downloads folder of your computer.

  • No files are overwritten
  • Existing folders are skipped
  • Handles problematic ZIP files better than default Windows extraction

Steps

1. Open your Downloads folder

  • This should have multiple .zip files that you wish to unbulk
    • It is preferred that you only have .zip files in this folder for the script

2. Open PowerShell in that folder

  • Click the address bar
  • Type: powershell
  • Press Enter
  • It should have the file path as PS C:\Users\~~USERNAME~~\Downloads>

3. Run the script

Copy and paste the following:

Add-Type -AssemblyName System.IO.Compression.FileSystem

Get-ChildItem -Filter *.zip | ForEach-Object {
    $destination = Join-Path $_.DirectoryName $_.BaseName

    if (-not (Test-Path $destination)) {
        try {
            [System.IO.Compression.ZipFile]::ExtractToDirectory($_.FullName, $destination)
            Write-Host "Extracted $($_.Name)"
        } catch {
            Write-Host "Failed: $($_.Name)"
        }
    } else {
        Write-Host "Skipping $($_.Name) (folder exists)"
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment