Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Video youtube
- https://youtu.be/HCjYaSu12Rg
- Codice
- ---------------------------------------------------------
- @echo off
- setlocal EnableExtensions DisableDelayedExpansion
- set "SourceFolder=C:\alfa\beta\gamma"
- set "LogExtract=%SourceFolder%\ExtractionLog.txt"
- set "LogError=%SourceFolder%\ErrorLog.txt"
- set "ArchiveExtracted="
- del /Q "%LogExtract%" "%LogError%" 2>nul
- for /D %%I in ("%SourceFolder%\*") do (
- if /I not "%%~nxI" == "done" (
- for %%J in ("%%I\*.rar" "%%I\*.zip") do (
- if exist "%%J" (
- echo Extracting "%%J" ...
- "%ProgramFiles%\WinRAR\WinRAR.exe" x -cfg- -ibck -logpfu="%LogExtract%" -o+ -y -- "%%J" "%%I\"
- if errorlevel 1 (
- set "ArchiveFile=%%J"
- >>"%LogError%" call echo Error %%ErrorLevel%% on extracting "%%ArchiveFile%%"
- ) else (
- set "#%%~nxI=%%I"
- set "ArchiveExtracted=1"
- echo %%~nJ| %SystemRoot%\System32\findstr.exe /I /R "\.part[0123456789][0123456789]*$" >nul
- if errorlevel 1 ( del /F "%%J" ) else for %%# in ("%%~nJ") do del /F /Q "%%I\%%~n#.part*%%~xJ"
- )
- )
- )
- )
- )
- endlocal
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement