Skip to content

Instantly share code, notes, and snippets.

@BenMcLean
Created August 15, 2021 23:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BenMcLean/fabc343e68ef7c44e70d1cbac86f035d to your computer and use it in GitHub Desktop.
Save BenMcLean/fabc343e68ef7c44e70d1cbac86f035d to your computer and use it in GitHub Desktop.
Compress Scans
@echo off
cd %~dp0
setlocal
setlocal enabledelayedexpansion
@echo off
for /d /r %%i in (Scans.) do (
@if exist "%%i" (
@set _scans=%%i
@echo !_scans!
cd %%i\..
"c:\Program Files\7-Zip\7z.exe" a "%%i.7z" "%%i\" & if not errorlevel 1 rd /s /q "%%i"
)
)
endlocal
pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment