DOS batch to zip archive and delete folder using 7zip

Save following commands to a text file and save it as archive.bat :

@echo offf
echo 7za a -r -tzip -mx9 %~f1\*.* 
7za a -r -tzip -mx9 %~f1\*.* 
rmdir /s/q %~f1

!!Caution, if you don’t have 7za installed it will only delete that folder!!


Drop any directory to the batch file, it will create a zip archive and delete that folder.

Similarly you can use following batch to just store (uncompressed) your folder:

@echo offf
echo 7za a -r -tzip -mx0 %~f1\*.* 
7za a -r -tzip -mx0 %~f1\*.* 
rmdir /s/q %~f1

If you don’t want to delete your folder just remove rmdir line.

Related Posts

NS Weight Release

WP-Backgrounds Lite by InoPlugs Web Design and Juwelier Schönmann 1010 Wien