Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for /r %%r in (*.zip *.7z *.rar *.ace) do 7z x -y "%%r" >nul && del "%%r" && echo unpacked "%%~nxr"
- :security
- cd /d "%~1" || echo no valid directory defined && exit /b
- attrib -s -h *.* >nul
- dir *.rar *.zip *.7z *.ace >nul 2>nul || exit /b
- :extract
- for %%r in (*.zip.001 *.7z.001 *.tar.001) do (
- 7z x -y "%%r" >nul && recycle -f "%%r" && echo unpacked "%%~nxr"
- if exist "%%r" echo unpack failed, maybe the disk is full? && exit /b
- recycle -f "%%~dpn.???" && echo multipart archives "%%~dpn.???" recycled
- )
- for %%r in (*.part1.rar *.part01.rar *.part001.rar) do (
- 7z x -y "%%r" >nul && recycle -f "%%r" && echo unpacked "%%~nxr"
- if exist "%%r" echo unpack failed, maybe the disk is full? && exit /b
- rem need a way to delete multipart volumes here
- )
- for %%r in (*.rar *.zip *.7z *.ace *.tar) do (
- 7z x -y "%%r" >nul && recycle -f "%%r" && echo unpacked "%%~nxr"
- if exist "%%r" echo unpack failed, maybe the disk is full? && exit /b
- if /i "%%~xr"==".rar" if exist "%%~dpnr.r00" recycle -f "%%~dpnr.r??" && echo multipart archives "%%~dpn.r??" recycled
- )
- goto security
- 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