← Back to team overview

dhis2-devs team mailing list archive

Windows batch file for conversion of 7z to ZIP

 

Hi again. Sorry for all the spam.

With the recent additions to trunk for allowing imports of DHIS 1.4
files to DHIS2, I have created (actually snarfed from here
http://aarmstrong.org/tutorials/mass-zip-rar-to-7zip-recompression-batch-file)
a batch file for mass conversion of 7z files to zip files, which can
then be imported into DHIS2.

May come in handy for some. Note, that this will delete the 7z files,
so you may want to modify to suit your needs.

Regards,
Jason


REM convert.bat
for %%F in (*.7z) do (
REM Extract...
"C:\Program Files\7-Zip\7z" x "%%F" -o"%%F contents"
REM Change directory, create 7zip of contents of directory...
CD "%%F contents"
"C:\Program Files\7-Zip\7z" a -tzip "../%%~nF.zip" *
CD ..
REM Delete the old files
DEL "%%F" /F /Q
RMDIR "%%F contents" /S /Q
)
pause