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
- 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
- Click the address bar
- Type:
powershell - Press Enter
- It should have the file path as
PS C:\Users\~~USERNAME~~\Downloads>
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)"
}
}