Created
April 18, 2014 15:11
-
-
Save cneud/11049141 to your computer and use it in GitHub Desktop.
Batch script for cleaning of data transfer directories in Europeana Newspapers
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 | |
REM recursively traverse through directories and delete all instances of JPG|PNG|TIF|JP2 image files | |
CHOICE /C:12345 /M "Really delete all images of type (1) JPG, (2) JP2, (3) TIF, (4) PNG or (5) Cancel?" | |
IF ERRORLEVEL 5 GOTO Cancel | |
IF ERRORLEVEL 4 GOTO PNG | |
IF ERRORLEVEL 3 GOTO TIF | |
IF ERRORLEVEL 2 GOTO JP2 | |
IF ERRORLEVEL 1 GOTO JPG | |
GOTO END | |
:JPG | |
ECHO. | |
ECHO Please wait while all JPG images are being deleted... | |
FOR /R %%i IN (.\*.JPG) DO DEL /S /Q "%%i" | |
ECHO Done! | |
GOTO END | |
:PNG | |
ECHO. | |
ECHO Please wait while all PNG images are being deleted... | |
FOR /R %%i IN (.\*.PNG) DO DEL /S /Q "%%i" | |
ECHO Done! | |
GOTO END | |
:TIF | |
ECHO. | |
ECHO Please wait while all TIF images are being deleted... | |
FOR /R %%i IN (.\*.TIF) DO DEL /S /Q "%%i" | |
ECHO Done! | |
GOTO END | |
:JP2 | |
ECHO. | |
ECHO Please wait while all JP2 images are being deleted... | |
FOR /R %%i IN (.\*.JP2) DO DEL /S /Q "%%i" | |
ECHO Done! | |
GOTO END | |
:Cancel | |
GOTO END | |
:END | |
@PAUSE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment