extract .zip files from multilple locations with Batch or Script file

Tellu Wsup 21 Reputation points

I have a bunch of folders that contain .zip files. is it possible to run a batch that will search for zip files in multiple folders and automatically unzip them in the parent folder?

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,456 questions
{count} votes

Accepted answer
  1. Andreas Baumgarten 103.8K Reputation points MVP

    Hi @Tellu Wsup ,

    maybe this helps: https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.archive/expand-archive?view=powershell-7.1

    Very simple approach:

    Get-ChildItem *.zip | Expand-Archive  

    If you already have a script it would be helpful to post it here. It's easier to help that way.


    (If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

    Andreas Baumgarten

1 additional answer

Sort by: Most helpful
  1. Limitless Technology 39,501 Reputation points


    First you will need to have 7zip installed on the machine, then create a BAT file in the parent folder with content:

    FOR /D /r %%F in ("") DO (
    pushd %CD%
    cd %%F
    FOR %%X in (
    .rar *.zip) DO (
    "<7zipfolderandfilepath>" x "%%X"

    *replace <7zipfolderandfilepath> for the folder where 7zip is installed (for example: C:\Program Files\7-zip\7z.exe)

    Hope it helps!

    Best regards,

    0 comments No comments