Systems, дополнил:
Код:
@echo off
:: Обрабатываемый диск
set "drive=E:"
:: Папка назначения
set "out=E:\_Backup_"
for /f "delims=" %%i in ('2^>nul dir /ad/b "%drive%\Cam_*"') do (
for /f "delims=" %%j in ('2^>nul dir /a-d/b/s "%drive%\%%i\*.avi"') do (
set file=%%~nj
call set "folder=%%file:~-20,4%%\%%file:~-27,6%%\%%file:~-16,2%%\%%file:~-14,2%%"
2>nul call md "%out%\%%folder%%"
>nul call move "%%j" "%out%\%%folder%%"
)
for /f "delims=" %%j in ('2^>nul dir /ad/b "%drive%\%%i\Video\Events"') do (
rd /q/s "%drive%\%%i\Video\Events\%%j"
)
)
exit /b
.