Created
August 15, 2021 23:42
-
-
Save BenMcLean/fabc343e68ef7c44e70d1cbac86f035d to your computer and use it in GitHub Desktop.
Compress Scans
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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