ZipTo7Zip

Extract zip files within the selected folder, remove Mac garbage files, and compress the files into a 7-Zip file. It's far from perfect but it works for me. So, you may want to adjust it for your needs.
mail@pastecode.io avatar
unknown
batchfile
3 years ago
487 B
6
Indexable
@echo off

cd %1

for %%f in (*.zip) do (

		mkdir "_trash"
		mkdir "_7z"


		"%ProgramFiles%\7-Zip\7z.exe" x *.zip -o* -y

		cd %%~nf
		RD /S /Q __MACOSX
		del /s /q /f /a .DS_STORE
		del /s /q /f /a ._*

		cd ../
		"%ProgramFiles%\7-Zip\7z.exe" a -r -t7z "%%~nf.7z" "%%~nf" -mx9 -ms -mmt
		
		move "%%~nf.7z" _7z/
		move "%%~nf" _trash/
		move "%%f" _trash/



		echo ****************** FOLDER : %%~nf *****************
		rd "_trash/" /s /q 
	)

rem pause