Q1- @echo off
- rem 清单和批处理全部保存为ansi编码
- set list=d:\清单.txt
- set dirpath=d:\test
- cd /d "%dirpath%"
- for /f "delims=" %%i in ('dir /b /s ^| sort /r') do (
- for /f "tokens=1-2 delims=+" %%a in ('find /i "%%~ni" ^< "%list%"') do (
- if /i "%%~ni" equ "%%a" (
- if exist "%%i\" (
- ren "%%i" "%%b"
- ) else (
- ren "%%i" "%%b%%~xi"
- )
- )
- )
- )
- pause
复制代码
|