bomiva
26-01-2022, 07:00
Привет всем, на страницах форума нашел данный скрипт от пользователя Iska. Возникает проблема с распаковкой архивов 7zip, пытался исправить самостоятельно , но все попытки потерпели неудачу. Помогите модифицировать этот скрипт чтобы распаковывал rar, zip и 7z . Можно через winrar или 7zip. Заранее спасибо!
@echo off
setlocal enableextensions enabledelayedexpansion
set sSourceFolder=E:\Песочница\0133\Source
set sDestFolder=E:\Песочница\0133\Destination
if exist "%sSourceFolder%\." (
if exist "%sDestFolder%\." (
for %%i in ("%sSourceFolder%\*.rar" "%sSourceFolder%\*.zip") do (
<nul set /p sValue=%%i
"C:\Program Files\WinRAR\WinRAR.exe" x -y "%%i" "%sDestFolder%\" && (
<nul set /p sValue=Ok
del /f /q "%%i" && echo Deleted|| echo.
) || echo Error
)
) else (
echo Destination folder [%sDestFolder%] not found
)
) else (
echo Source folder [%sSourceFolder%] not found
)
endlocal
exit /b 0
@echo off
setlocal enableextensions enabledelayedexpansion
set sSourceFolder=E:\Песочница\0133\Source
set sDestFolder=E:\Песочница\0133\Destination
if exist "%sSourceFolder%\." (
if exist "%sDestFolder%\." (
for %%i in ("%sSourceFolder%\*.rar" "%sSourceFolder%\*.zip") do (
<nul set /p sValue=%%i
"C:\Program Files\WinRAR\WinRAR.exe" x -y "%%i" "%sDestFolder%\" && (
<nul set /p sValue=Ok
del /f /q "%%i" && echo Deleted|| echo.
) || echo Error
)
) else (
echo Destination folder [%sDestFolder%] not found
)
) else (
echo Source folder [%sSourceFolder%] not found
)
endlocal
exit /b 0