Sunday, July 6, 2025

BAT file to extract all zipped files from a source folder to target folder

In a folder there are many zipped files at Source Path = C:\Users\ajeet\Desktop\Sources_zips. If you want to extract all zip files in one go then you can use BAT file.
@echo off
setlocal

set "ZIPFOLDER=C:\Users\ajeet\Desktop\Sources_zips"
set "DESTFOLDER=%ZIPFOLDER%\Extracted"

if not exist "%DESTFOLDER%" (
    mkdir "%DESTFOLDER%"
)

for %%I in ("%ZIPFOLDER%\*.zip") do (
    "C:\Program Files\7-Zip\7z.exe" x "%%I" -o"%DESTFOLDER%\%%~nI" -y
)

echo All files extracted.
pause



No comments:

Post a Comment

Hot Topics