Имя пользователя:
Пароль:  
Помощь | Регистрация | Забыли пароль?  

Показать сообщение отдельно

Новый участник


Сообщения: 21
Благодарности: 0

Профиль | Отправить PM | Цитировать


Цитата megaloman:
@Echo Off
Set "Mask=*.??-??.*cab"
Set "Exclude=.ru-RU. .en-GB. .en-US. .de-DE."
Set "BoxIn=%~dp0"
rem Set "BoxIn=%userprofile%\Desktop\ElsaWin"
Set "Log=%userprofile%\Desktop\%~nx0.log"
If "%BoxIn:~-1%"=="\" Set "BoxIn=%BoxIn:~0,-1%"
Call :PushdLog "%Log%"
>~Exclude.tmp (For %%e IN (%Exclude%) DO Echo %%e)
>"%Log%" (FOR /F "usebackq delims=" %%f IN (`Xcopy "%BoxIn%\%Mask%" "%Tmp%" /Exclude:~Exclude.tmp /S /L`) DO (
If Exist "%%f" Echo Del "%%f" &Del /F "%%f" 2>&1
))
Del ~Exclude.tmp
Popd
GoTo :Eof
:PushdLog
Pushd "%~dp1"
GoTo :Eof »
Ваш новый скрипт удаляет, но всё равно не все файлы.

Некоторые остаются.

Маска поиска не подходит похоже.

slp.N.es-ES#graphics.cab
www..hr-HR#llf.cab
и т.п.

Скоро докачается новый архив у меня, попробую такой вот код:
Код: Выделить весь код
Set "BoxIn=%~dp0"
Set "Ext=*.??-*.cab"
Set "Exclude=*ru-RU* *en-GB* *en-US* *de-DE*"
Set "Log=%userprofile%\Desktop\%~nx0.log"

pushd "%BoxIn%" || (pause & exit /b)
del "%Log%" 2>NUL

set nS=0& set /a nF=0
FOR /f "delims=" %%f IN ('dir /b /a-d %Exclude%') DO set ""%%~nxf"=1"
FOR %%f IN ("%BoxIn%\%Ext%") DO if not Defined "%%~nxf" (
  del /f /a "%BoxIn%\%%~nxf" &&(>>"%Log%" echo Удалено: "%%~nxf"& set /a nS+=1) ||(>>"%Log%" Не удалено: "%%~nxf" & set /a nF+=1)
)
(echo Результат выполнения:
echo Удалено файлов: %nS%
echo Не удалено файлов: %nF%
popd) >> "%Log%"
type "%Log%"
pause
Потом отпишу.

Отправлено: 20:07, 07-10-2017 | #19