Guest User

Untitled

a guest
Nov 24th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. for /r %%r in (*.zip *.7z *.rar *.ace) do 7z x -y "%%r" >nul && del "%%r" && echo unpacked "%%~nxr"
  2.  
  3. :security
  4. cd /d "%~1" || echo no valid directory defined && exit /b
  5. attrib -s -h *.* >nul
  6. dir *.rar *.zip *.7z *.ace >nul 2>nul || exit /b
  7.  
  8. :extract
  9. for %%r in (*.zip.001 *.7z.001 *.tar.001) do (
  10. 7z x -y "%%r" >nul && recycle -f "%%r" && echo unpacked "%%~nxr"
  11. if exist "%%r" echo unpack failed, maybe the disk is full? && exit /b
  12. recycle -f "%%~dpn.???" && echo multipart archives "%%~dpn.???" recycled
  13. )
  14.  
  15. for %%r in (*.part1.rar *.part01.rar *.part001.rar) do (
  16. 7z x -y "%%r" >nul && recycle -f "%%r" && echo unpacked "%%~nxr"
  17. if exist "%%r" echo unpack failed, maybe the disk is full? && exit /b
  18. rem need a way to delete multipart volumes here
  19. )
  20.  
  21. for %%r in (*.rar *.zip *.7z *.ace *.tar) do (
  22. 7z x -y "%%r" >nul && recycle -f "%%r" && echo unpacked "%%~nxr"
  23. if exist "%%r" echo unpack failed, maybe the disk is full? && exit /b
  24. if /i "%%~xr"==".rar" if exist "%%~dpnr.r00" recycle -f "%%~dpnr.r??" && echo multipart archives "%%~dpn.r??" recycled
  25. )
  26.  
  27. goto security
  28.  
  29. for /F %%f in ('dir /b /a-d *.zip *.7z *.rar *.ace ^|findstr /REIV /C:".part[0-9][0-9]*.rar"') do @(7z x -y "%%f" >nul && del "%%f" && echo unpacked "%%~nxf")
Add Comment
Please, Sign In to add comment