Advertisement
Najeebsk

Compressing-Multiple-Files-Into-Bzip2.bat

Feb 20th, 2022
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 0.67 KB | None | 0 0
  1. @echo off
  2.  
  3.  
  4. for /f %%i in ("%1") do (
  5.     echo %%~di
  6.     echo %%~pi
  7.     echo %%~xi
  8.     set rootpath="%%~di%%~pi*%%~xi"
  9. )
  10.  
  11. for /R %%f in (*) do (
  12.     "C:\Program Files\7-Zip\7z.exe" a -tbzip2 "%%f.bz2" "%%f" -mx9 -x!"packall.bat"
  13.     del "%%f" /s /f /q
  14. )
  15.  
  16. echo Finished operations!
  17. goto exit
  18.  
  19. :usage
  20. echo You have to drag and drop a file on this batch script!
  21. echo Sorry for the poor documentation, but if you'll want to use it, you have to edit the .bat file
  22. echo The only thing you really need is to change the path to your 7-Zip installation
  23. echo Then simply drag and drop a file in a folder you want to BZip2, and it'll do the rest automatically
  24.  
  25. :exit
  26. pause
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement