acoolrocket

Extract each .zip to its respective subfolder for multiple zips (Powershell)

Jan 29th, 2025 (edited)
10
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. $zipFiles = Get-ChildItem -Path . -Filter *.zip
  2. foreach ($zip in $zipFiles) {
  3. $folderName = $zip.BaseName
  4. New-Item -Path $folderName -ItemType Directory -Force
  5. Expand-Archive -Path $zip.FullName -DestinationPath $folderName
  6. }
  7.  
  8. ### To execute, type powershell in the directory bar in Windows Explorer, then paste the code.
Advertisement
Add Comment
Please, Sign In to add comment