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

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

Ветеран


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

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


Arsenik77,
Т.е. те, что исключение перемещать в корень, а остальные удалять?
Код: Выделить весь код
@echo off
setlocal

set "exclude=.txt .jpg .mp3"

for /d %%i in ("generalfolder\*") do (

    pushd "%%i"
    for /d %%j in (*) do (
    
        for /f "tokens=*" %%k in (' "2>nul dir /b /s /a-d "%%j"" ') do call:move "%%k"

    )
    popd
    
)
goto:eof

:move
for %%i in (cnt file check) do set "%%i="

for %%i in (%exclude%) do if /i "%%i"=="%~x1" set check=1
if not defined check del /a /q /f %1 && goto:eof

set "file=%~nx1"

:check
set /a cnt+=1
if exist "%file%" set "file=%~n1(%cnt%)%~x1" && goto:check

move %1 "%file%"

Отправлено: 10:55, 18-08-2011 | #13