- @echo off
- set "ph=E:\MOVIE"
- if not exist "%ph%\" exit
- for %%i in ("%ph%\..") do pushd "%%~dpi"
- (for /f "delims=" %%a in ('dir /b/s/a-d "%ph%\*.nof"') do (
- setlocal enabledelayedexpansion
- for /f "tokens=*" %%i in ('findstr /i "<title> <year>" "%%a"') do (
- for /f "tokens=1,2delims=<>" %%j in ("%%i") do (
- set %%j=!%%j!%%k
- )
- )
- echo ren "%%~dpa" "!title!(!year!)"
- endlocal
- ))>"%temp%\$.t"
- sort /r "%temp%\$.t" >"%temp%\$.cmd"
- pushd "%temp%\"
- call "$.cmd"
- del $.t $.cmd
- popd
- pause
复制代码
|