Skip to content

Instantly share code, notes, and snippets.

@rcerrejon
Last active October 11, 2023 08:16
Show Gist options
  • Save rcerrejon/bdf2b44779965eed77874db9c79aa45b to your computer and use it in GitHub Desktop.
Save rcerrejon/bdf2b44779965eed77874db9c79aa45b to your computer and use it in GitHub Desktop.
Batch Compress folders with 7zip in Windows
@ECHO OFF
FOR %%i IN (*.*) DO (
ECHO "%%i" | FIND /I "zip.bat" 1>NUL) || (
"c:\Program Files\7-Zip\7z.exe" a -tzip "%%~ni.zip" "%%i"
if %ERRORLEVEL% == 0 del "%%i"
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment